WebForm_DoPostBackWithOptions is not defined

2019-02-25 10:37发布

I downloaded and setup MS's Stock Trader app. I'm running Vista Ultimate, IIS7, VS 2008 / .NET 3.5. The entire app is about 120 MB so is quite involved but it all seemed to setup fine from the msi. When I run the app and try to login I get a javascript error after clicking the Login link:

WebForm_DoPostBackWithOptions is not defined

When I view the page source the Login link renders the following:

<a id="LinkLogin" class="Button" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;LinkLogin&quot;, &quot;&quot;, false, &quot;&quot;, &quot;Login.aspx&quot;, false, true))">Login</a>

I've googled this and found a solution that people have used in IIS 6:

Bring up IIS and right-click on your virtual directory. Select "Properties". On the Virtual Directory tab in the Application Settings section, click the "Configuration" button. This brings up the "Mappings" tab. Highlight the entry for ".axd" and click "Edit". Be sure that the lower left-hand checkbox for "Check that File Exists" is unchecked! If not, uncheck it and click "OK". The WebResource.axd references you see when doing "View Source" on a .NET webpage don't actually link to a physical file, so if this box is checked then the scripts don't get loaded correctly.

However I can't see how to do the above in IIS 7. There is a "Handler Mappings" section with 2 entries for "WebResource.axd" but not with the settings mentioned above. Does anyone have a solution to the problem, or know how to implement the IIS 6 fix above in IIS 7?

2条回答
可以哭但决不认输i
2楼-- · 2019-02-25 10:52

One solution is to set the LinkButton CausesValidation=false

查看更多
贼婆χ
3楼-- · 2019-02-25 10:59

I know that this is a bit late, but hopefully this can help future searchers.

Under Handler Mappings, right click and click Edit. Then click Request Restrictions, there is a mapping tab - selecting "Invoke handler only if request is mapped to" and "File" is equivalent to "check if file exists".

查看更多
登录 后发表回答