Tips for deploying an ASP.NET Ajax website

Jan 05, 2009 by Constantin Ionescu


Microsoft ASP.NET Ajax is a great platform, and provides lots of functionalities, but you need to know your way around it, to make the most of its capabilities. Today I'll be writing down a couple of tips that will help you when deploying an Ajax website in IIS.

Situation 1. Immediately after deployment, if browsing to an Ajax page, you might see this error in your browser:

'AjaxControlToolkit' is undefined

GET http://localhost/test/ScriptResource.axd?d=iC9u4a78................PFFORnlt_DO9ehkk_A2&t=633537850300000000
500 Internal Server Error

This problem can show up if you are using the ASP.NET Ajax Control Toolkit that Microsoft provides for free at http://www.asp.net/ajax/ajaxcontroltoolkit/.

The server returns this error if the AjaxControlToolkit.dll has the "last modified" time stamp bigger than the server machine's current time. In this case, the site will display the error listed above. This problem frequently occurs if making the deployment on a remote server (e.g. our office is in Europe whereas many of our deployments are on server machines located in the United States).

So the solution for this issue is to change the "last modified" date-time of your DLL, and make it smaller than the server's time. You can do this using the Touch.exe tool, from Windows 2000 Resource Kit. If you don't have that kit (which has been discontinued by Microsoft) then you can go to http://www.stevemiller.net/apps/ and download the Win32 Console ToolBox 1.0 , which contains a 3rd party freeware version of touch.exe. Or, as a last resort, there's also a touch.exe in the Microsoft Windows Services for UNIX 3.5 suite (which is pretty big though, around 200MB), available at http://www.microsoft.com/DownLoads/details.aspx?familyid=896C9688-601B-44F1-81A4-02878FF11778&displaylang=en

Situation 2. If you get past that initial issue, then still you could have problems with the Ajax-related actions/events, i.e. the website is not running as expected, and there's that warning icon in the status bar of your browser, indicating that there are errors in the JavaScript code.

At this point, you need to make sure that the ASP.NET Ajax platform is installed on the server-machine. If it's not, then you need to install it, using the kit downloaded from http://www.asp.net/ajax/downloads/ .


Tags: Ajax  ASP.NET  Programming     


Comments


Nicki commented on 9/3/2009 1:32:53 PM

I found out the VERY hard way today that if you have HTTP compression enabled on the site, it causes problem mentioned in 1. Turn it off, restart IIS - error GONE!

Constantin Ionescu commented on 9/8/2009 11:10:49 AM

Nicki, your note made me curious, so I've tried to reproduce the issue. No error showed up when using the default IIS compression, but when switching to a 3rd party compression library (FlatCompress ISAPI) the error did occur indeed. So thanks for the tip!


cv commented on 4/5/2011 5:02:48 AM


Your Comment:







Blog Home   Contact
or go to the SBP website

Twitter Updates

Follow SBP on Twitter >>

Recent blog entries



Archives

All tags