的ImageButton不火后回IE10 [英] ImageButton does not fire a post back on IE10

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

问题描述

最近,我们测试了我们的产品在IE10和遇到一个问题关于服务器按钮控制ASP:ImageButton的都无法在与IE10的UpdatePanel解雇。
而下面是样本code:

Recently, we tested our products on IE10 and encountered a problem about that server button control "Asp:ImageButton" are not be fired on IE10 with UpdatePanel. And the below is the sample code:

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        Here is the content.
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="buttonSubmit" />
    </Triggers>
</asp:UpdatePanel>
<br />
<br />
<asp:Button ID="buttonSubmit" runat="server" ToolTip="Submit" OnClick="buttonSubmit_Click" />
</form>

服务器端:

    protected void buttonSubmit_Click(object sender, ImageClickEventArgs e)
    {
        ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "alert", "alert('It works.')", true);
    }

下面是它混淆了我两件事情:
一个是这个问题只有当我在IIS上部署情况和VS.调试时工作正常
二是,如果我删除了上面的两个标签BR,该事件将被解雇。此外,如果我改变的ImageButton到按钮,事件也将被解雇。

Here are two things which confused me: One is the issue only happens when I deployed on IIS and works fine when debugging on VS. The two is if I removed the upper two tag "br", the event would be fired. Besides, if I change the ImageButton to Button, the event also would be fired.

所以,我不知道如果我失去了一些东西或者误解的ImageButton与Button控件的生命周期。
任何帮助将非常AP preciate。

So, I don’t know if I am missing something or misunderstand the life circle of the ImageButton and Button control. Any help would very appreciate.

测试环境:VS2010,IIS 7.5,IE10(10.0.9200.16484)

Test environments: VS2010, IIS 7.5, IE10(10.0.9200.16484)

推荐答案

只需安装.NET框架4.5可以解决这个问题。

这问题可以通过ImageButton的IE10错误,这涉及到IE10不正确的坐标转换为十进制数,而不是整数引起的。这导致的ImageButton点击在很多失败,如果不是大多数,对IE10的情况。

This problem can be caused by the ImageButton IE10 bug which involves IE10 incorrectly converting coordinates to decimal rather than integer. This causes ImageButton clicks to fail in many, if not most, situations on IE10.

这可以解决这个问题,即使你不切换应用程序池到.NET框架4.5。

This can fix the problem even if you do not switch your application pool over to .NET Framework 4.5.

在我的情况,我离开了应用程序池在.NET Framework 3.5的。显然,在安装的.NET Framework 4.5将覆盖其他的框架版本的一些文件。

In my case, I left the app pools at .NET Framework 3.5. Apparently installing .NET Framework 4.5 overwrites some files for other framework versions.

请参阅变通办法部分<一个href=\"https://connect.microsoft.com/VisualStudio/feedback/details/755419/asp-net-4-0-and-ie10-click-on-imagebutton-in-updatepanel-produces-error-click-on-normal-button-does-not\">here

相关报道:<一href=\"http://stackoverflow.com/questions/13299685/ie10-sending-image-button-click-coordinates-with-decimals-floating-point-values/15129393#15129393\">IE10发送图像按钮点击带有小数(浮点数),ASP.NET抛出ParseInt32 FormatException

这篇关于的ImageButton不火后回IE10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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