WebForm_DoPostBackWithOptions 未定义

WebForm_DoPostBackWithOptions is not defined(WebForm_DoPostBackWithOptions 未定义)
本文介绍了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 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)