ASP.net AJAX deployment error

When adding ASP.net AJAX code to a web application hosted in IIS, you may get this javascript error "Sys is undefined" when running the application. Aside from tweaking the configuration settings in web.config, this error means there are javascripts that cannot be found/is not defined. In the case where the code was not created from the standard ASP.net AJAX web application template in Visual studio, you may get this error because there are javascript resource files created during runtime, which are not physical files on the server. In order to fix this problem, we have to tell IIS to bypass verifying the existence of .axd files when executing the application.

Here are the steps to complete:

  • Right click the web application in IIS
  • Choose Properties
  • Click the Home Directory tab
  • Click the Configuration button
  • From the list of application extensions, select the .axd option, then click Edit
  • Ensure the Verify that file exists checkbox is unchecked