- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试向 ASP.NET 4 页面添加一个简单的 LinkButton
,但它没有调用 IE10 中的postback
。代码如下所示。
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#:
protected void Page_Load(object sender, EventArgs e) { }
protected void LinkButton1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}
如您所见,这只是一个普通页面。但是,自从升级到Win8和IE10后,我无法让LinkButton
调用该方法。这在 Firefox 中工作得很好。
有什么想法我需要做什么吗?
最佳答案
这是服务器修补/更新问题。 ASP.NET 尚未发出正确的 JavaScript 供您的浏览器运行。它不知道比 IE9 更新的 IE 版本。
请参阅 Scott Hanselman 的帖子:
Scott 在 2011 年的这篇文章中指出,修复程序应通过 Windows 更新分发。确保您的服务器通过 Windows Update 获得最新的 .NET Framework 服务更新。如果没有,you can download the patch或read more details on the Microsoft KB .
此修复将更新那些 .browser
文件,从而允许 ASP.NET 发出正确的标记和 JavaScript。
%WinDir%\Microsoft.NET\Framework(64?)\v4.0.30319\CONFIG\Browsers\ie.browser
这将包含这样的项目:
<!-- 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>
关于asp.net - IE10 中的 LinkButtons 不执行回发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12449934/
我是一名优秀的程序员,十分优秀!