Tuesday, 20 October 2009

Postbacks Not Working in ASP.NET

I was deploying an application to a Development server, and noticed that when I tested anything which caused a postback, the page would simply refresh and the postback would not work.

When accessing the site on the server itself using the localhost address, it worked fine.


Then I checked if it was working in Firefox, and lo and behold - it was!

Even more bizarre.

But apparently, it's something to do with validators which are specific to IE. It detects the browser, then if it's IE it sends specific JavaScript down to cause validation of postbacks.

The solution? Copying the aspnet_client folder into the root of our IIS installation's Default Web Site and restarting IIS. Once I closed my IE session and accessed the site again, the postbacks started working.