ASP.NET AJAX Beta 2 Gotcha

I was porting samples from ASP.NET AJAX Beta 1 to Beta 2 today and ran into a problem that I suspect others will run into, too. A custom script file that loaded fine in Beta 1 wouldn’t load in Beta 2. Turns out that Beta 2 adds a new requirement to custom script files for Safari compatibility: the files have to have a callback function named Sys.Application.notifyScriptLoaded. The function doesn’t have to do anything, but it does have to be defined. So, simply add the following line to any custom JS files that you load into your ASP.NET AJAX apps:

Sys.Application.notifyScriptLoaded();

Of course, this will cause a script error if the JS file is used outside of ASP.NET AJAX. To make the script file work with or without ASP.NET AJAX, use this line:

if (typeof(Sys) !== ‘undefined’) Sys.Application.notifyScriptLoaded();

Other than that, I’ve encountered few problems getting my Beta 1 code to run in Beta 2.

 

Stay Informed

Sign up for the latest blogs, events, and insights.

We deliver solutions that accelerate the value of Azure.
Ready to experience the full power of Microsoft Azure?

Atmosera is thrilled to announce that we have been named GitHub AI Partner of the Year.

X