最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - WebForm_DoPostBackWithOptions is not defined - Stack Overflow

programmeradmin0浏览0评论

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?

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?

Share Improve this question asked Oct 14, 2010 at 13:30 Ciarán BruenCiarán Bruen 5,34113 gold badges61 silver badges69 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

One solution is to set the LinkButton CausesValidation=false

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".

发布评论

评论列表(0)

  1. 暂无评论