F5を押すたびに再現する安定したエラーがあります。
2 つのグリッド (master-detail) があり、メイン グリッドで focus-row-changed イベントが発生したときにクライアント コードによって発生したコールバックで実際にエラーが発生します。このようなもの:
this.mainGrid.ClientSideEvents.FocusedRowChanged = string.Format(@"
function(s, e)
{{
if (typeof({0}) != 'undefined')
{0}.PerformCallback(s.GetFocusedRowIndex());
}}",
this.detailsGrid.ClientInstanceName);
このバグはmozilla firefoxでのみ再現されます! (はい、IEは問題にされていません。それはちょっと奇妙です =))
そして非常に重要なこと: バグは、イベントの検証がオンになっている場合にのみ再現されます。つまり:
... EnableEventValidation="false" %> // no error in this case
その理由は、必要なフィールドがロードされる前にコールバックが発生することであると示唆しました(私が得たように、イベント検証ではいくつかの非表示フィールドが使用されます)setTimeout
。
this.mainGrid.ClientSideEvents.FocusedRowChanged = string.Format(@"
function(s, e)
{{
window.setTimeout(function () {{
if (typeof({0}) != 'undefined') {0}.PerformCallback(s.GetFocusedRowIndex());
}}, 2000);
}}",
this.detailsGrid.ClientInstanceName);
しかし、それは役に立ちませんでした。2 秒が経過すると、コールバックが開始され、エラーが発生します。更新時にのみ発生します。ページが最初に読み込まれたときにエラーは発生しません。グリッドの行キャッシュを無効にしても役に立ちませんでした。手伝いが必要!=))
編集:これがStackTraceです
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded()
at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
at System.Web.UI.WebControls.HiddenField.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.WebControls.HiddenField.System.Web.UI.IPostBackDataHandler.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.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.solutions_cashcenter_stockmanagement_frames_takeintostorageordersviewframe_aspx.ProcessRequest(HttpContext context) in c:\Users\udod\AppData\Local\Temp\Temporary ASP.NET Files\website\b07be668\e534e3ef\App_Web_jeqyhxze.10.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Edit2:「EnsureEventValidationFieldLoaded」 - はい、この点はわかりますが、2 秒待っても読み込まれないのはなぜですか?
Edit3: これはIISの問題ではないことに気付くかもしれません(スクリーンショットの 127.0.0.1 ip)。
編集:アップ!!!