This project is read-only.


Modal Popup with usercontrol inside panel


Opened again by Stephen Walther on May 8, 2013

I have a usercontrol inside a panel, that I would like to display, but I keep on receiving : Microsoft JScript runtime error: Unable to get value of the property 'UI': object is null or undefined
Latest Nu-get Ajax Toolkit
.net 4.0

file attachments

Closed Oct 21, 2015 at 4:06 PM by MikhailTymchukDX
It seems that this error is caused by ToolkitScriptManager. Starting with the v15.1 release, we have removed it.


mwolfaardt wrote Apr 4, 2011 at 8:19 PM

Sys.Application.add_init(function() {
$create(Sys.Extended.UI.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground","CancelControlID":"cphMain_cat_btnClose","PopupControlID":"cphMain_cat_panel1","dynamicServicePath":"/Products/add","id":"cphMain_cat_ModalPopupExtender1"}, null, null, $get("cphMain_cat_btnShowPopup"));

jtrahan wrote Apr 7, 2011 at 7:42 PM

I found that if you turn off CombineScripts it starts working properly. I think the Script Combiner is what really has the issue.

mwolfaardt wrote Apr 10, 2011 at 4:13 PM

Hi jtrahan, thank you for your reply, this solved my problem.

Superexpert wrote May 3, 2011 at 5:22 PM

We were unable to reproduce this issue with the April 2011 release of the Ajax Control Toolkit. I've attached the pages which we used to try to reproduce the issue. Be warned that the NuGet version of the Ajax Control Toolkit is older than the version which you can download from the CodePlex site.

Superexpert wrote May 3, 2011 at 5:23 PM

Repro Pages (Could not reproduce issue)

Superexpert wrote May 3, 2011 at 5:23 PM

Could not reproduce this issue

** Closed by Superexpert 05/03/2011 9:23AM

ErikdeWilde wrote Jul 4, 2011 at 8:56 AM

Thanks jtrahan!

I had the same problem but with the new Editor, it worked locally and on my staging server, but not on the production server. I also got the error "Microsoft JScript runtime error: Unable to get value of the property 'UI': object is null or undefined".

I've added CombineScripts="false" on the masterpage and the Editor works fine now

hamid_massaelly wrote Nov 12, 2012 at 6:19 AM

Thanks jtrahan!

ncwatt wrote May 7, 2013 at 11:38 PM

This issue should be re-opened. It still exists. The solution posted here to use CombineScripts=false resolves the issue. But surely this is a workaround?? The whole point on combining scripts it to make the pages download faster?

ssandu wrote Jul 30, 2013 at 9:07 AM

The error still exists on .NET 4.5 with the latest version. So reverting back to v4.1.5116 and jQuery 1.2.6 works fine on .NET 4.5

masterw wrote Sep 19, 2013 at 2:24 PM

Use the ToolkitScriptManager instead of the default ScriptManager.

<asp:ScriptManager ID="ScriptManager1" runat="server">

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

airbornetrojan wrote Sep 27, 2013 at 7:37 PM

@masterw: your fix worked.

Bill_H wrote Oct 11, 2013 at 3:10 PM

Replacing scriptmanager with toolkitscriptmanager on a masterpage doesn't work for me on a large very mature VS2012 .net 4.0 project. We have masterpages that need a scriptmanager, and content pages that need a proxy. Using Toolkitscriptmanager is not a option, because the content pages need a proxy and toolkitscriptmanager on the masterpage will not work with scriptmanagerproxy, and the content pages will not work without the proxy.

There are some comments on other forums that a toolkitscriptmanager on the masterpage means that the content pages will not need a scriptmanagerproxy. That is absolutely not true. There are also some comments on other forums that infer that a toolkitscriptmanager will work with scriptmanagerproxy, also not true.

In summary, we get the same error on every toolkitextended control. Yes, ajaxtoolkit is registered correctly in the web.config, yes, it is registered on both the masterpages and contentpages.


hintzen wrote Apr 18, 2014 at 9:52 PM

I am also getting this error, and like Bill_H I have ScriptManagerProxy on my content pages as well as EXTENSIVE usage of global resources (which is specifically not supported by the toolkitScriptManager) because this is a internationalized application.

So other than using the toolkitScriptManager I don't see another work around available.

schlubadub wrote Apr 23, 2014 at 7:33 AM

@Bill_H I use the Ajax Control Toolkit ToolkitScriptManager with the standard ASP.NET ScriptManagerProxy... It works perfectly on dozens of pages (for a big corporate site) so I'm not sure what your issue is. I had some issues a long time ago which meant I had to add EnableSecureHistoryState=false in the ToolkitScriptManager options... make sure EnableHistory=True as well.

mlatko wrote Aug 9, 2014 at 12:18 PM

@masterw: your fix worked for me too! Tnx!