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>
server side:
protected void buttonSubmit_Click(object sender, ImageClickEventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "alert", "alert('It works.')", true);
}
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.
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.
Test environments: VS2010, IIS 7.5, IE10(10.0.9200.16484)
Simply installing .NET Framework 4.5 can fix this problem.
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.
This can fix the problem even if you do not switch your application pool over to .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.
See the workarounds section here