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.