ASP.NET 4.0は、Internet Explorer 10によってトリガーされたImageButtonイベントを処理する準備ができていないようです。問題は、IE10が画像のクリック座標をdouble値(10進数)として送信し、ASP.NETがそれらを整数として解析して表示することです。次のタイプのエラー:
System.Web.HttpUnhandledException (0x80004005):
Exception of type 'System.Web.HttpUnhandledException' was thrown.
---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.members_addtocartlogin_twostep_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\932deaba\63ff7eeb\App_Web_MyPage.aspx.28424a96.oraym_un.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
ぐるぐる回って、互換表示でIE10を実行するように強制することを提案する人もいます。ただし、メタタグを追加して<meta http-equiv="X-UA-Compatible" content="IE=10" />
も何も解決されません。<?xml version="1.0" encoding="UTF-8">
前に追加<!DOCTYPE>
しても機能しません。
解決策はありますか?Javascriptでクリックイベントをキャプチャし、小数をなんとかして削除できますか?
注: Framework 4.5にアップグレードして再コンパイルすると、バグが修正されます。ランタイムバージョンはまだ4.0なので、変更する必要はありません。