frameworks - ASP.Net Invalid Viewstate error -


I'm randomly experiencing the following error:

Message: Invalid viewstate. Client IP: xx.xxx.xxx.xx Port: 2324 User-agent: Mozilla / 4.0 (compatible; MSI 7.0; Windows NT 6.0; SLCC 1; NAT CLR 2.0.50727; Media Center PC 5.1; InfoPath 2; NET CLR 3.5.30729; .NET CLR 3.0.30618) ViewStat:

Stack trace:

Message: Invalid length for base-64 character array. Stack trace: On system. Convert.Foambabs at 64 string (strings) system. Web. UI. ObjectStatformer System in SystemFileing (String Input String) Web. UI. ObjectStatformer System Web. UIISTATFORMER.

Do somebody debug me on this system.Web.Util.DeserializeWithAssert (IStateFormatter formatter, String serializedState) in System.Web.UI.HiddenFieldPageStatePersister.Load () on Dyserailise (String Serialated State) What does it tell about? One of the reasons was fixed with .NET 3.5 SP1.

I do not know which framework you are using and you can update or not. If you can not do this, you can override your base-class render-system so that the above viewers are given at the top:

  Private static string [] aspNetFormElements = New string [] {"__EVENTTARGET", "__EVENTARGUMENT", "__VIEWSTATE", "__EVENTVALIDATION", "__VIEWSTATEENCRYPTED",}; Preserve Override Zero Submission (HtmlTextWriter Writer) {Stringwolder StringWare = New Stringer (); HtmlTextWriter htmlWriter = new HtmlTextWriter (stringWriter); Base.Render (htmlWriter); String HTML = String Writer.ToString (); Int formStart = html.IndexOf ("& lt; form"); Int endForm = -1; If (formStart> = 0) endForm = html.IndexOf ("& gt;", FormStart); If (endorm = gt; = 0) {stringbilder view statebuilder = new string builder (); Front (string elements in Esperanto form elements) {int startPoint = html.IndexOf ("& lt; input type = \" hidden \ "name = \" + + + "+" \ ""); if (startpoint & gt; = 0 & amp; amp; amp; amp; Start Page & gt; Endormum) {int endpoint = html.InxOf ("/>", Start Page); if (Endpoint => = 0) {endPoint + = 2; String viewStateInput = html.Substring (Startpoint, Endpoint - Startpoint); Html = html. Remove (Start Page, End Page - Start Page); ViewStateBuilder.Append (viewStateInput) .Append ("\ r \ n");}}} If (viewstabilder 0] {viewStateBuilder.Instert (0, "\ r \ n"); html = html.nsert (endForm + 1, viewstatebuilder.tostring ());}} write author (html);}  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -