WebForm_DoPostBackWithOptions 未定义 [英] WebForm_DoPostBackWithOptions is not defined

查看:25
本文介绍了WebForm_DoPostBackWithOptions 未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载并设置了 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&quot;, &quot;", false, &;quot;&quot;, &quot;Login.aspx&quot;, false, true))">登录</a>

我在谷歌上搜索了这个并找到了人们在 IIS 6 中使用的解决方案:

打开 IIS 并右键单击您的虚拟目录.选择属性".在应用程序设置部分的虚拟目录选项卡上,单击配置"按钮.这将打开映射"选项卡.突出显示.axd"条目并单击编辑".确保未选中检查文件存在"的左下方复选框!如果没有,请取消选中它并单击确定".您在 .NET 网页上执行查看源代码"时看到的 WebResource.axd 引用实际上并未链接到物理文件,因此如果选中此框,则脚本将无法正确加载.>

但是,我看不到如何在 IIS 7 中执行上述操作.有一个处理程序映射"部分,其中包含 2 个WebResource.axd"条目,但没有上述设置.有没有人有解决问题的方法,或者知道如何在 IIS 7 中实现上面的 IIS 6 修复?

解决方案

一种解决方案是设置LinkBut​​ton 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(&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?

解决方案

One solution is to set the LinkButton CausesValidation=false

这篇关于WebForm_DoPostBackWithOptions 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆