23 February 2007
Fix for “WebForm_PostBackOptions is undefined” error
Posted by Barnabas under: Programming .
Recently while working on a new ASP.NET 2.0 project, I encountered a JavaScript error which ended with the text “WebForm_PostBackOptions is undefined”. This was confusing because I had simply added a login control to an otherwise empty page. After some searching, I found a blog post where a SharePoint MVP solved this problem by excluding the file “WebResource.axd” from SharePoint processing.
I’m not using SharePoint. However, in the Global.asax file, I add a System.IO.Compression.GZipStream or DeflateStream to the response filter in the PreSendRequestHeaders event if the user agent supports it. A post in the microsoft.public.dotnet.framework.aspnet.webcontrols newsgroup seemed to confirm that the file WebResource.axd doesn’t like to be compressed. While it seems clunky, adding an exception to the filter to disallow dynamically compressing this file seemed to fix this error. I am posting this as search engine bait in case anyone else is having difficulties with ASP.NET validator controls throwing JavaScript errors and doesn’t realize that dynamic GZip/Deflate compression of WebResource.axd is causing the problem.
2 Comments so far...
Oguz Celikdemir Says:
21 May 2007 at 2:50 am.
Thanks for your help. I solved my problem which I had using Httpzip software. I added a exclusion for *.axd file to the Httpzip.
shobha Says:
12 August 2008 at 4:51 am.
hi.. i m facing the same problem. can u pls tell me in detail where will i get this WebResource.axd and how to compress. i serached in my sytem not able to find out..