DevExpress / AjaxControlToolkit

The ASP.NET AJAX Control Toolkit is a classic set of ASP.NET WebForms extensions.
https://devexpress.com/act
BSD 3-Clause "New" or "Revised" License
290 stars 137 forks source link

"Cannot read property 'UI' of undefined" error when ScriptManager.LoadScriptsBeforeUI="false" #221

Closed slemoineizysolutions closed 8 years ago

slemoineizysolutions commented 8 years ago

I developped a WebSite using AjaxControlToolKit V4.1.7.1213 and I needed to update to 16.1.1.0. I replace the ToolScriptManager by the standard ScriptManager. I removed everything I have to in the Web.config.

However, I still have an error On Chrome : Uncaught TypeError: Cannot read property 'UI' of undefined On Firefox : TypeError: Sys.Extended is undefined

Framework : 4.5 ACT V4.1.7.1213 : Use the DLL that I referenced in the Bin ACT V16.1.1.0 : Use the installer, then I remove the reference and referenced it again by "Add a reference" (I don't know if it's understandable...)

Here is the web.config : ` <?xml version="1.0"?>

`

MikhailTymchukDX commented 8 years ago

Hi @slemoineizysolutions , I have checked your Web.config content and noticed that the <add TagPrefix="ajaxToolkit" ... /> tag is commented out. Did you try uncommenting it?

Would you please also provide page markup that shows this error?

slemoineizysolutions commented 8 years ago

Hi,

It's commented because the Register is in each page when I need it. It can be removed in the web.config.

The error appears in each page where I used an ACT control, specially TabContainer and ModalPopupExtender. I didn't change anything in the controls.

Here an example :

` <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dashboard.aspx.cs" Inherits="Dashboard" MasterPageFile="~/MasterPages/MasterPage.master" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> <%@ Register Assembly="iZyWebServerControl" Namespace="iZyWebServerControl" TagPrefix="iZy" %>

/asp:Content ```



<%--Popup Relance--%>
``` /asp:Content` I'm sorry, the code seems not to appear well-formed.
MikhailTymchukDX commented 8 years ago

Thank you for response. The markup does look like a valid one.

Please perform the following steps to make sure that you load the correct version of the assembly:

  1. Remove the assemblyBinding section from Web.config if possible.
  2. Remove the reference to the AjaxControlToolkit assembly.
  3. Add AjaxControlToolkit NuGet package to the project.

If you encounter an error after these steps, please provide:

  1. A screenshot of the browser's console with the error message(s).
  2. Page source (Ctrl+U hotkey in Chrome).
slemoineizysolutions commented 8 years ago

I doesn't work...

capture

`

<!DOCTYPE html>

[DEV] Activa Formation ``` ```
``` ``` ```
Dev ```
``` ```
Tableau de bord
Date début Date finN° ArchivageLibelléTypeClient(s)Formateur(s)StatutTarif total
Aucune session à afficher
```

`

Thanks for your time :)

MikhailTymchukDX commented 8 years ago

Thank you for posting this data. There is an old ToolkitScriptManager loaded at line 107:

Sys.WebForms.PageRequestManager._initialize('ctl00$ToolkitScriptManager1', 'form1', ['tctl00$updatePanelMaster','updatePanelMaster','tctl00$BodyContent$upGeneral','BodyContent_upGeneral','tctl00$BodyContent$upPopups','BodyContent_upPopups'], [], [], 90, 'ctl00');

Please check your master page and make sure you replaced all ajaxToolkit:ToolkitScriptManager occurrences with asp:ScriptManager.

slemoineizysolutions commented 8 years ago

This is the ScriptManager, I didn't change the control ID.

Here is the MasterPage

`<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPages_MasterPage" %>

<!DOCTYPE html>

Activa Formation ``` ``` ```
<%-- --%> Prod Test Dev
```

`

MikhailTymchukDX commented 8 years ago

Thank you for providing the master page markup. I was able to reproduce this error when I set the ScriptManager.LoadScriptsBeforeUI property to false.

While we are researching the impact of this setting to the toolkit, I would recommend setting it to true as a workaround.

slemoineizysolutions commented 8 years ago

It works ! The error doesn't appear anymore if I set the property to true.

What is the impact of the setting ScriptManager.LoadScriptsBeforeUI ?

Thank you very much for your help and your reactivity :D

MikhailTymchukDX commented 8 years ago

Our research showed that it is possible to use ScriptManager with the LoadScriptsBeforeUI property set to false, but AJAX Control Toolkit requires this option to be set to true.

Please refer to this article for more details.