问题描述
我下载并设置了 MS 的 Stock Trader 应用程序.我正在运行 Vista Ultimate、IIS7、VS 2008/.NET 3.5.整个应用程序大约有 120 MB,因此相当复杂,但从 msi 看来一切都设置得很好.当我运行应用程序并尝试登录时,单击登录链接后出现 javascript 错误:
WebForm_DoPostBackWithOptions 未定义
当我查看页面源代码时,登录链接呈现以下内容:
<a id="LinkLogin" class="Button" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("LinkLogin", "", false, &;quot;", "Login.aspx", false, true))">登录</a>
我在谷歌上搜索了这个并找到了人们在 IIS 6 中使用的解决方案:
打开 IIS 并右键单击您的虚拟目录.选择属性".在应用程序设置部分的虚拟目录选项卡上,单击配置"按钮.这将打开映射"选项卡.突出显示.axd"条目并单击编辑".确保未选中检查文件存在"的左下方复选框!如果没有,请取消选中它并单击确定".您在 .NET 网页上执行查看源代码"时看到的 WebResource.axd 引用实际上并未链接到物理文件,因此如果选中此框,则脚本将无法正确加载.>
但是,我看不到如何在 IIS 7 中执行上述操作.有一个处理程序映射"部分,其中包含 2 个WebResource.axd"条目,但没有上述设置.有没有人有解决问题的方法,或者知道如何在 IIS 7 中实现上面的 IIS 6 修复?
一种解决方案是设置LinkButton CausesValidation=false
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("LinkLogin", "", false, "", "Login.aspx", 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?
One solution is to set the LinkButton CausesValidation=false
这篇关于WebForm_DoPostBackWithOptions 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!