Blog
ASP.NET PostBackUrl not working on Server
April 2, 2010 Author: Joel
Scenerio: I have a simple contact form in which I want to post to a different page.
Pretty simple, just set the PostBackUrl property of the button to the page I want to post to. It works like it should locally. When I deploy it to the server, Rackspace Cloud, it doesn’t work.
Research: After Binging for a while I found that the issue was due to a javascript error. If you VIew Source of the page, you’ll notice that the rendered html uses javascript to perform the PostBack.
<input style=”border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px” id=”imgButton” class=”submit” onclick=”javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("imgButton", "", false, "", "/quick-contact.aspx", false, false))” src=”/i/qcsubmit.gif” type=”image” name=”imgButton” />
I then was able to capture the javascript error in IE. *Sidenote, what is a good way to do this? I ended up putting my cursor in the form, hit enter and quickly clicked on the browser stop button. There must be a better way.
![]()
“Webform_PostbackOptions” is undefined.
Ok…. Why is that? I found this in the comments at a blog post on http://pocketnerd.blogspot.com/2008/01/webformpostbackoptions-is-undefined.html
“I was getting this error in a load balanced production environment, but once the network admin turned on sticky sessions, all the errors went away. I assume it was trying to load the .axd file from the other web server and perhaps that caused a security problem which didn’t allow the file to load. Not sure but just thought I’d share what fixed it for me. “
I don’t have server access when hosting in the Cloud.
The WebForm_PostBackOptions function should be in the WebResource.axd file that you’ll see is referenced in the html on load.
<script src=”/WebResource.axd?d=Ttwk99ZBtJ8argpvGbO64g2&t=633750447951477990″ type=”text/javascript”></script>
I tried browsing to this file and this indeed was the issue, 404 Not Found.
Solution: I loaded the page locally. Viewed Source, grabbed the WebResource.axd and querystring, browsed to this file. This gave me the output of the javascript. I copied that all and placed it into a postbackfix.js file. I then referenced this js file on the page. Uploaded the new js and aspx files. Works now.
This took me a few hours of banging my head (not to Quit Riot) to figure out. Hope this helps someone else.
-
http://topsy.com/trackback?utm_source=pingback&utm_campaign=L1&url=http://blog.dahlindevelopment.com/2010/04/asp-net-postbackurl-not-working-on-server/ Tweets that mention ASP.NET PostBackUrl not working on Server « Dahlin Development – Blog — Topsy.com
-
http://www.vibramshoesonline.com five finger
-
http://www.vibramfivefingerse.com vibram fivefingers
-
http://www.christianlouboutintobuy.com christian louboutin
-
Categories
- asp.net (12)
- Blog (3)
- Business (5)
- Conferences (1)
- Errors (5)
- Office (1)
- Portfolio (3)
- Reviews (3)
- SEO (4)
- SQL Server (4)
- Tips (2)
- Uncategorized (2)
- Web Development (14)
-
Archives