Skip navigation.

Tightening View State BeltAll recent posts1.x To 2.0 Migration Tip: Office Web Components Cause Compilation Error

1.x To 2.0 Migration Tip: Where Did WebForm_ DoPostBackWithOptions Go?

We’re finally cutting over from 1.1 to 2.0. As I’ve mentioned a number of times, I prefer the Web Application Project model to the Web Site model. Even though our product is of decent size, the migration wizard in VS2K5 did a good job, and I spent most of tweaking simply replacing deprecated methods here and there.

One thing that jumped out at me right away was an issue with a plain Button control, which, upon a click, would raise a JavaScript error. It was complaining it couldn’t find the WebForm_DoPostBackWithOptions function. My button was making this odd call:

<input type="submit" value="Log in" id="btnLogin"
onclick="javascript:WebForm_DoPostBackWithOptions(…)" />

Searching in newsgroups didn’t turn up much. It seems to be quite a common migration issue with no definitive answer.

The missing script is supposed to be served by a faux HttpHandler, WebResource.axd. Somebody suggested that an HttpModule could interfere with the handler.

I went to my web.config and commented one HttpModule after another until I noticed the HTTP compression module by Ben Lowery was the culprit.

Now, I’m a big proponent of HTTP compression and I love Ben’s module. I need to dig in and figure this out, though.

Fortunately, the solution is quite simple. If you have Ben’s HttpModule installed, find the <excludedPaths> section in web.config and add WebResource.axd to exclusions:

<excludedPaths>
   <add path="WebResource.axd"/>
</excludedPaths>

Comments

Comment permalink 1 Daniel Steigerwald |
Same problems, same solutions :-)
Comment permalink 2 Matt T |
Thank you, thank you, thank you. After 3 hours of reading of people complaining about this issue, this was the only site that had a definitive answer.
Comment permalink 3 Alan Kirk |
Hi,
Im only using NeatUpload from Brettle Development for file uploads in my project. removing this HTTPModule makes no difference I still get this WebForm_DoPostBackWithOptions undefined error. Viewing the source of the page in the browser shows a couple of links to WebResource.axd
??
Any help would be appreciated!
Cheers
Alan
Comment permalink 4 Vince Zalamea |
I'm using the blowery compression too because it works well. Too bad it interferes with the webresource.axd file. I used your solution and it worked! Thank you very very much!
Comment permalink 5 zawmn83 |
I use DotNetNuke 4.5.1 and meet same error.
Adding



can't solve the error.
Comment permalink 6 Alan Kirk |
If you get that error it just means that the .axd file has not been served by the web server so the javascript function is not there in the web page source, hence the javascript error.

I've had this same issue now a few times with different projects / installs and it is always just that IIS6 has not got the .axd file extension added in following the install of .Net framework 2.0. Manually add .axd (click the 'configuartion' button on the virtual directory you are using on IIS) and point it at the isapi.dll for framework 2.0 and that should fix it.

If you want too see whats going wrong in more detail, google for "fiddler" +microsoft and download and install fiddler. It shows you all the http requests as they happen.
cheers
Alan
Comment permalink 7 Vicente Garcia Zuñiga |
El error se corrigue add the web.confing


Comment permalink 8 Vicente Garcia Zuñiga |
Bueno ya q no puedo colocar la solucion comento q se resuelve colocando en el archivo web.config
httpHandlers tres keys for this function


add path="trace.axd" verb="*" type="System.Web.Handlers.TraceHandler" validate="True" />
add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
add path="*.axd" verb="*" type="System.Web.HttpNotFoundHandler" validate="True" />
Comment permalink 9 cmjones74 |
You may want to check that there aren't duplicate entries for your website's ISAPI application extensions (i.e. one for .Net 1.1 and one for .Net 2.0). Check under your website properties->Home Directory->Configuration

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

TrackBacks

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):