The state information is invalid for this page and might be corrupted. (Only in IE)

前端 未结 4 703
迷失自我
迷失自我 2020-12-09 20:56

Can anybody help me out with this exception. I have tried couple of fixes but nothing worked. I am getting this exception only in IE(7, 8 and 9).

When i load the pa

4条回答
  •  既然无缘
    2020-12-09 21:54

    Ok, so here is the solution/hack i came up with. My problem was that adding a user control dynamically (through ajax request) onto page was changing the view state of the page and was throwing an exception. Upon research I found out that viewstate stores the state of a page (properties and settings). Once you return the controls html from a web service, there is going to be some sort of viewstate stored onto page. And when you post back to the server, it will throw an exception when it decrypt the viewstae to rebuild the page. I have simply removed those controls (which got added dynamically) on page post back using jquery and problem got solved.

    //In my case "VendorListDropDownSearchable", causes the page post back.
        $("#VendorListDropDownSearchable").change( function () {
            $("#UserControl1DIV").remove(); //removing the place holder holding control1
            $("#UserControl2DIV").remove(); //same as above
        });
    

提交回复
热议问题