简体   繁体   English

IE10中的LinkBut​​tons未执行回发

[英]LinkButtons in IE10 not performing posting back

I'm trying to add a simple LinkButton to an ASP.NET 4 page but it's not calling the postback in IE10. 我正在尝试将一个简单的LinkButton添加到ASP.NET 4页面,但它没有在IE10中调用postback The code looks like as follows. 代码如下所示。

HTML: HTML:

<form id="form1" runat="server">
<div>
  <asp:LinkButton ID="LinkButton1" runat="server"
    OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
  <br />
  <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>    

C#: C#:

protected void Page_Load(object sender, EventArgs e) { }

protected void LinkButton1_Click(object sender, EventArgs e)
{
  Label1.Text = DateTime.Now.ToString();
}

As you can see, it's just a plain page. 如您所见,它只是一个简单的页面。 However, I cannot get the LinkButton to call the method since upgrading to Win8 and IE10. 但是,自升级到Win8和IE10以来,我无法让LinkButton调用该方法。 This works fine with Firefox. 这适用于Firefox。

Any ideas what I need to do? 有什么想法我需要做什么?

This is a server patching/updating problem. 这是服务器修补/更新问题。 ASP.NET has not emitted the correct JavaScript for your browser to run. ASP.NET没有为您的浏览器发出正确的JavaScript来运行。 It's not aware of IE versions newer than IE9. 它不知道IE版本比IE9更新。

See Scott Hanselman's post on this: 请参阅Scott Hanselman的帖子:

ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error or maintain FF5 scrollbar position ASP.NET无法检测IE10导致_doPostBack未定义JavaScript错误或维护FF5滚动条位置

Scott notes in this 2011 post that the fix should be distributed via Windows Update. Scott在2011年的帖子中指出,修复程序应该通过Windows Update分发。 Ensure your server is up to date with .NET Framework service updates from Windows Update. 确保您的服务器是最新的Windows Update .NET Framework服务更新。 If not, you can download the patch or read more details on the Microsoft KB . 如果没有, 您可以下载补丁阅读Microsoft KB上的更多详细信息

The fix will update those .browser files allowing ASP.NET to emit the correct markup and JavaScript. 该修补程序将更新那些.browser文件,允许ASP.NET发出正确的标记和JavaScript。

%WinDir%\\Microsoft.NET\\Framework(64?)\\v4.0.30319\\CONFIG\\Browsers\\ie.browser %WINDIR%\\ Microsoft.NET \\框架(64?)\\ v4.0.30319 \\ CONFIG \\浏览器\\ ie.browser

This will contains items like this: 这将包含以下项目:

  <!-- Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) -->
  <browser id="IE10Plus" parentID="IE6Plus">
    <identification>
      <capability name="majorversion" match="\d{2,}" />
    </identification>
    <capabilities>
      <capability name="jscriptversion" value="6.0" />
    </capabilities>
  </browser>

You have patch who patch introduces the updated definitions in the browser definition files for Internet Explorer and Mozilla Firefox. 您有补丁修补程序在Internet Explorer和Mozilla Firefox的浏览器定义文件中引入了更新的定义。 The browser definition files are stored in the following folders, depending on the installed version of Microsoft Framework le.NET: 浏览器定义文件存储在以下文件夹中,具体取决于安装的Microsoft Framework le.NET版本:

For 32-bit versions of the Framework 4.0.NET 对于32位版本的Framework 4.0.NET

% WinDir% \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ CONFIG \\ Browsers %WinDir%\\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ CONFIG \\ Browsers

For 64-bit versions of the Framework 4.0.NET 对于64位版本的Framework 4.0.NET

% WinDir% \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ CONFIG \\ Browsers %WinDir%\\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ CONFIG \\ Browsers

Download Patch here : http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2600088&kbln=fr 点击此处下载补丁: http//support.microsoft.com/hotfix/KBHotfix.aspx? kbnum = 2600088&kbln = fr

Link : http://support.microsoft.com/kb/2600088 链接: http//support.microsoft.com/kb/2600088

It was due to the security settings in IE10. 这是由于IE10中的安全设置。 For some reason my local intranet settings were stricter than public websites. 出于某种原因,我的本地Intranet设置比公共网站更严格。 So I couldn't click on hyperlinks, but I could click on buttons which submitted forms. 所以我无法点击超链接,但我可以点击提交表单的按钮。

你应该安装.Net Framework 4.5,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM