ImageButton does not fire a post back on IE10

假如想象 提交于 2019-11-30 10:00:56
Brian Webster

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

Related: IE10 sending image button click coordinates with decimals (floating point values) causing a ParseInt32 FormatException

IE10 has a bug. If you develop a new aspx page and and ajaxify the page with updatepanels, the page won't work correctly.No server events will fire. But other browsers will do their job fine.I wonder why haven't microsoft noticed/fixed this issue. I handled the problem with forcing IE9 mode

<meta http-equiv="x-ua-compatible" content="IE=9" />

Change ImageButton to a LinkButton and put the image inside of it.

It is a nice workaround, that's work for me.

I changed the ImageButton to a LinkButton and put the button image inside of it. Works.

You can do the same thing in the Page_PreRender

private bool alert;
protected void buttonSubmit_Click(object sender, EventArgs e)
    {

        alert= true;
        ViewState["alert"] = alert;
    }

protected void Page_PreRender(object sender, EventArgs e)
    {
        if (ViewState["alert"] != null)
            alert= (bool)ViewState["alert"];
        if (alert)
        {
            alert= false;
            ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "alert", "alert('It works.')", true);

        }
    }

Update Panel doesn't work correctly in IE 10 with button clicks,images etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!