May 2010 - Posts

PostBackUrl not working? Make sure JavaScript is enabled.

 Seems obvious now but this one had me scratching my head for an hour this morning. The web application in question downgrades gracefully if JavaScript isn't enabled everywhere else except for a couple of pages were we were using PostBackUrl on a button control to get around an issue that required that we use no query strings on the page it was redirecting to and we couldn't use session state. I was unaware that this feature required JavaScript on the client until today.

You might be asking yourself - who has JavaScript disabled these days? - well some companies lock down their internal computers for security reasons and one of the lockdowns in this case was disabling JavaScript for IE.

Thankfully I was able to solve the issue by reworking each of the pages so that a POST request wasn’t required anymore and just used a hyperlink. If that hadn’t have been the case I’d have had to create a html form outside of the ASP.Net form to get it to work without JavaScript.

Posted by Damien McGivern with no comments