Categories: BlogWeb Development

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.

 

Jeff Prosise

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

3 weeks ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

4 weeks ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

1 month ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

2 months ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

2 months ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago