Jan 24, 2007

Postbacks not working in ASP.NET

This was a weird one....

I recently setup a web application on a testing machine (which had a bunch of other web applications on it).  The front login page appeared OK, but when I tried login I just got blank pages back.  If I tried bringing up pages manually (ie by entering the URL directly) they appeared but as soon as I tried anything that did a postback I got the blank pages again.  All the postbacks had stopped - however it was in IE only.  Using the application from Firefox worked fine.

Obviously something unusual was afoot.

About the only thing I could see that was unusual was that the default web site is stopped (and can't be started) because there is a named web application running under the default URL.  And anyway, this is perfectly legitimate and shouldn't cause this sort of problem.

So, what's a guy to do?  Time for Google.

It turns out that I ran across an entry about problems with validators and IE that was interesting.  One of the most interesting things was one of the comments that said:

Well, the only advice I can give without seeing your setup is to make sure you also have the "aspnet_client" directory either in web root or in the web app folder.

So I coped the aspnet_client directory from the default web site to the broken web application and viola! It worked!  Postbacks were OK, the application worked fine and all was well with the world again.

 

Like I said - weird!

1 comment: