Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


WebForm_PostBackOptions is undefined

Posted on 2007-04-10
Medium Priority
Last Modified: 2013-11-26

I recently deployed my application to our server and have been receiveing the “WebForm_PostBackOptions is undefined” error on several pages (after a button is clicked).  I’ve done hours of research on this issue and have tried many of the suggestions to fix this error.  

First, let me give you a little information about my application:

•      The app was recently converted to ASP.NET 2.0
•      On the server, it uses a new application pool for asp 2.0
•      Includes several 3rd party controls (RADControls, Intersoft WebGrid and WebCombo)
•      Runs fine on my local machine
•      Error usually occurs when a button is clicked.  The page will still perform the operation, but a javascript error will be displayed before the page reloads.  
•      My server is running Windows Server 2003 and using IIS 6.0.  
•      The Application is under a domain with an SSL certificate.
•      We have another 2.0 application (built from scratch, not converted) running flawlessly on the same server.  
•      The ASP.Net property for the virtual directory in IIS is set to use 2.0.
•      For deployment, I compiled the project locally and pushed the files to the server.  

I think the problem is with the WebResources.axd file.  For some reason, the application cannot extract the needed scripts from it.  I took someone’s suggestion of viewing the source for a page, locating a call to the WebResources.axd file, copying the link, and pasting in a browser window.  This should return the requested script, however I get an error message: “Session state is not available in this context.”  I’m also a little confused about where the WebResources.axd file is located.  Does anyone know where it is? Is it embedded in a dll?  Should it be in the root directory?

It should be noted that the RADControls were not working correctly at first.  By default, they try and access the WebResources.axd file.  I had to insert UseEmbeddedScripts=”false” in every control declaration, which forces them to use the scripts contained in the RADControls folder.  This fixed the problem.

I’ve also done the following to try and fix the errors.  
•      in IIS, opened the properties for the virtual directory, clicked configuration, and verified that the .axd extension was mapped to c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll.  I also verified that the checkbox was unchecked for “Verify if file exists”.  
•      Verified that the asp.net 2.0 installation was installed correctly.  Like I mentioned above, we have another 2.0 application that runs flawlessly.  

I came across a couple cases where this error message was fixed by including the WebForms.js file in the root directory and adding a reference to it on all pages.  I have not tried this because I don’t exactly know how to get this WebForms.js file.  I’ve searched my computer for it with no luck.  I read that it is included in the System.Web dll, but I’m unsure as to how to extract this.  Does anyone know how to do this?  

Does anyone know of any other solution or suggestions to fix this javascript error?  

Thank you in advance for your help.
Question by:ideamatics
  • 5
  • 4
  • 2
LVL 27

Expert Comment

ID: 18884059
have you tried another project with just a test page?
try that on the same server and see if it works then you may a problem with the custom controls you have. if the test doesnt work you will have to re install asp.net 2.0 on the server.

Good luck

Author Comment

ID: 18884651
Hi Sammy,

I don't believe that the controls are to blame.  There are many pages that include the RADControls where the WebForm_PostBackOptions error is not displayed on button clicks.  Also, this error appears on other pages that do not use the RADControls at all.  

I also don't think that the ASP.Net 2.0 reinstallation will fix the problem.  We already have a .NET 2.0 application running flawlessly on the server (also uses RADControls). However, It should be noted that that application is in another application pool and uses a different SSL certificate.  Do you still suggest a reinstall of 2.0?
LVL 27

Expert Comment

ID: 18885458
Just to understand this better, you have some pages within the same application using the same application pool that run fine with any error?
The only thing I can think of is the your WebResource.axd is not being served over SSL
try this
delete all files in "You may have to restart you app to do so"
C:\WINDOWS\Microsoft.NET\Framework\Version Number\Temporary ASP.NET Files
Clear your temp files


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 18885699
Hi Sammy,

Yes you are correct.  Some of my pages work without a problem.  I restarted my webserver and cleared the temporary asp.net files.  I also cleared my local temporary internet files.  Still no luck. The error remains.  I checked my temp files and noticed that the WebResources.axd file is not there.  So you could be correct in that the WebResource.axd file is not being served over SSL.  

Any idea on how to fix this? Any idea on how to extract the WebForms.js from System.Web?  Thanks!
LVL 27

Expert Comment

ID: 18885859

Author Comment

ID: 18887163
I took a look at the two pages.  The first one was pretty interesting, although i don't see how it is applicable to my issue.  I read the paragraph at the bottom that talked about the webresource.axd file...however it told the reader how to set a property so the application ignores webresources.axd.  It seems that there is a communication problem between the application and the webresources.axd file.  I'm note even sure if this file is being generated as it is not in my temporary internet files.

I also thought the second page was interesting, and i learned a few things from it.   Unfortunately, the debug is already set to false in my webconfig.  

Thanks for the suggestions. Any more ideas???
LVL 27

Accepted Solution

Sammy earned 2000 total points
ID: 18887276
Try this
Open the application in IIS
Under the virtual directory click on the configuration button
on the mapping page click on the mapping tab, click on .aspx extension and click on insert "Middle of t he dialog" then browse to the asp.net aspnet_asapi.dll "should be in the framework directory"
Make sure you DON'T have "Verify this file exists"
restart your app and see if that works


Author Comment

ID: 18887315
Ouch! All of my images were broken, all 3rd party controls did not display/function properly, and the WebForms_PostBackOptions error still remains.  

Author Comment

ID: 18890979
Ok I found a solution to my problem.  My initial assessment was correct in that I needed to directly reference the WebForms.js file on all of my pages.  The problem was that I could not find instructions on where the WebForms.js file was or how to extract it.  The process is as follows:  Navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0....
Open the System.Web.dll file using notepad.  The first part of the file will all be special characters.  Scroll down until you see javascript.  Copy all of the javascipt there (be sure to include the first function listed, which is WebForm_PostBackOptions) and paste into a text document.  save the text document as WebForms.js.  You might have to comb through the javascript and delete any special characters.  I deleted about 5-10.  Next, place the WebForms.js file in the root directory of your application and include this file in all of your pages by placing "<script src="WebForms.js" type="text/JavaScript"></script>" in the <HEAD> of your page.  That's it! The error was fixed.  This is a workaround and i'm still curious as to what is causing the error.  I know that it all goes back to the WebResources.axd file.  If anyone has any ideas, please let me know.  

Also, thanks Sammy1971 for your help!

Expert Comment

ID: 19263909
Did you look on the server to see if anything was preventing the .axd extension from being served?  

We had this problem on our web farm recently, and in IIS 6.0 the extension .axd for the web application had the "Verify File Exists" button checked.  However, WebResources.axd is being served from a temporary location (directly to the client browser cache) and therefor seemed to not exist, and was then ignored.  Unchecking "Verify File Exists" eliminated the problem.

We also had cases where SiteMinder was being used for Authentication. The SiteMinder WebAgent ISAPI filter (in IIS) was mapped to * extensions with the "Verify File Exists" button clicked... again, in these cases, removing the "Verify File Exists" resolved the problem.

Here's a problem with the solution you chose - what if there is an update to .NET Framework 2.0, or if some later generation of .NET Framework alters the client-side scripts?  You will then have to update the webforms.js file... blech.

You perhaps could have also tried the following:
a)      Aquire WebResource.axd (you can usually find this in Internet Explorer Temporary Internet Files), otherwise - search the web via Google for this file and it is availabe here and there.  If you take a look at this article, it also explains how to retrieve it: http://support.microsoft.com/kb/931762/
b)      Then, the following must be done on each server *blech*
c)       Using IIS Management Console, go to the Application Configuration application by selecting home directory tab for the web site (if this is a virtual on a Shared Web Site, then choose the virtual so this change is applied at the virtual level and not the entire web site), then clicking Configuration button.
d)      The 1st tab for Application Configuration will be the Mappings tab
e)      View the Executable Path and Verbs used for .aspx
a.      Executable Path is likely:  C:\WINNT\Micorosoft.NET\framework\framework\v2.0.50727\aspnet_isapi.dll  (please verify)
b.      Verbs:  Limit To:  GET, HEAD, POST, DEBUG (please verify)
c.      Check Enabled for: Script Engine  (please verify)
f)      Add a mapping for the .AXD extension pointing to the exact .DLL and which is mapped to the .aspx
a.      Extension:  .axd
b.      Executable Path is likely:  C:\WINNT\Micorosoft.NET\framework\framework\v2.0.50727\aspnet_isapi.dll
c.      Verbs:  Limit To:  GET, HEAD, POST, DEBUG
d.      Check Enabled for: Script Engine
g)      Click OK.
h)      When prompted, do not choose to apply the app mapping change to all of the other virtuals.
i)      Repeat above steps on each server in this farm.


Expert Comment

ID: 19263916
Sorry - append these steps to a) in my post above, to Copy the WebResource.axd file to the root folder of your website... on the page you receive the error, you can view source, and search for WebResource.axd, it should show you which folder or virtual to place the file...

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question