Frage

I have a stable error that reproduces each time i hit F5: Error

There are 2 grids (master-detail) and the error actually happens on callback that is raised by my client-code when focused-row-changed event occurs on main grid. Something like this:

    this.mainGrid.ClientSideEvents.FocusedRowChanged = string.Format(@"
                function(s, e) 
                {{
                        if (typeof({0}) != 'undefined')
                            {0}.PerformCallback(s.GetFocusedRowIndex());
                }}",
                this.detailsGrid.ClientInstanceName);

The bug only reproduces in mozilla firefox! (yep, IE is not under question, that's kinda strange =))

And very important thing: the bug only reproduces when event validation is on, that is:

... EnableEventValidation="false" %>   // no error in this case

I suggested that the reason is that callback gets fired before the necessary fields get loaded ( as i got it, event validation uses some hidden fields ), so i checked that using 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);

But tat didn't help. 2 seconds pass, callback starts and i receive the error. It only occurs on refresh - no error is raised when the page is loaded first time. Disabling rows-cache for grid also didn't help. Need assistance! =))

Edit: here's the 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' - yes, i see this point, but...how could it not get loaded if i wait for 2 seconds???

Edit3: You might notice that this is not an IIS problem (127.0.0.1 ip on screenshot).

Edit: UP!!!

War es hilfreich?

Lösung

Yesterday I run into the same error and found a similar problem here: http://sietch.net/ViewNewsItem.aspx?NewsItemID=185

my current workaround is:

$(document).ready(function(){
    $('#__EVENTVALIDATION').attr('autocomplete', 'off');
});

it seems to work. But im still testing.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top