keyongtech


  keyongtech > dotnet.framework.aspnet.* > dotnet.framework.aspnet.main > 02/2006

 #1  
02-02-06, 09:32 AM
GTi
I have a ASP 2.0 page where I use some Ajax code. The Ajax code
(JavaScript) is inserted from CodeBehind.
In my page I have a submit button and some links for Ajax functions.
When I load the page and use the submit button it give me some results
that is fine.
Then I press the links that activate the Ajax Code the results is
displayed fine on my page.
- BUT -
If I then press the submit button again I get this error:
"The state information is invalid for this page and might be corrupted"
That happens only if I activate the Ajax Code. If I don't I can press
the submit button without any problems.

I think the whole problem is the hidden __VIEWSTATE.
I don't think I use it at all - Is it possible to remove it and still
have sessions variables?

Screen output:
-----------------------------------------------------------------------------------------
Source Error:
[No relevant source lines]

Source File: d:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary
ASP.NET Files\mes\80fad5dd\dd8b6fcb\App_Web_aehuzojs.4.cs Line: 0

Stack Trace:
[FormatException: Invalid character in a Base-64 string.]
System.Convert.FromBase64String(String s) +0
System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString)
+72

System.Web.UI.ObjectStateFormatter.System.Web.UI.I StateFormatter.Deserialize(String
serializedState) +4
System.Web.UI.Util.DeserializeWithAssert(IStateFor matter formatter,
String serializedState) +37
System.Web.UI.HiddenFieldPageStatePersister.Load() +140

[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port: 4406
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
ViewState:
/wEPDwUKMTc5OTcyNjkwMg9kFgICAw9kFgICAQ8WAh4JaW5uZXJ odG1sBeUsCgo8IS0tIEFVVE8gQ09OVEVOVCAtLT48aW5wdXQgd HlwZT0iaGlkZGVuIiBuYW1lPSJBQkJNRVNET0NXSVRIIiBpZD0 iQUJCTUVTRE9DV0lUSCIgdmFsdWU9IjAiIC8+PGlucHV0IHR5c GU9ImhpZGRlbiIgbmFtZT0iQUJCTUVTRE9DSElHSFQiIGlkPSJ BQkJNRVNET0NISUdIVCIgdmFsdWU9IjAiIC8+PCEtLSBFTkQgT 0YgQVVUTyBDT05URU5UIC0tPgo8IS0tIEJFR0lOTklORyBPRiB DT05URU5UIFNFQ1RJT04gLS0+PGRpdiBzdHlsZT0iaGVpZ2h0O jEwcHgiPjwvZGl2Pgo8ZmllbGRzZXQgY2xhc3M9RmllbGRzZXR DbGFzcz48dGFibGUgY2xhc3M9VGV4dEZpZWxkIGJvcmRlcj0iM CI+PHRyPjx0ZD5TZWxlY3QgUmVwb3J0IHR5cGU6PGJyLz48c2V sZWN0IGNsYXNzPUVkaXRGaWVsZCBzaXplPSIxIiBuYW1lPSJSZ XBvcnRUeXBlIiB0aXRsZT0iU2VsZWN0IFJlcG9ydCB0eXBlIiB vbmNoYW5nZT0idGhpcy5mb3JtLnN1Ym1pdCgpOyIgPjxvcHRpb 24gdmFsdWU9IjAiID5TZWxlY3QgUmVwb3J0IHR5cGU8L29wdGl vbj48b3B0aW9uIHZhbHVlPSIxIiA+U2VhcmNoIGJ5IERhdGU8L 29wdGlvbj48b3B0aW9uIHZhbHVlPSIyIiBzZWxlY3RlZCA+U2V hcmNoIEVuZCBQcm...]

[HttpException (0x80004005): The state information is invalid for this
page and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Except ion inner, String
persistedState, String errorPageMessage, Boolean macValidationError)
+116
System.Web.UI.HiddenFieldPageStatePersister.Load() +240
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +83
System.Web.UI.Page.LoadAllState() +35
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6953
System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context)
+18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.pluginpage_aspx.ProcessRequest(HttpContext context) in
d:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\mes\80fad5dd\dd8b6fcb\App_Web_aehuzojs.4.cs: 0

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+154
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +64
 #2  
02-02-06, 05:36 PM
Sonu Kapoor
To disable the ViewState use the EnableViewState property and set it to false. Although I believe that you should check why you are getting this error. If you are using a third party ajax library, then you might want to ask the author about that as well.

Sonu Kapoor [MVP]
 #3  
02-03-06, 07:43 AM
GTi
My bad !!!
My Ajax code was returning a complete html page including a new
__VIEWSTATE field.
After a Page.Response.Clear() in the Ajax result code it works just
fine !!!
Similar Threads
Change __VIEWSTATE to something else

Is it possible to change the __VIEWSTATE id? The reason is we shouldn't have any id starting with underscores on XHTML pages. Thank you

AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta

The JoyiStar AJAX WebShop development team is proud to announce the release of JoyiStar AJAX WebShop 3.0 Beta for Personal Edition. This release is a major improvement in...

__VIEWSTATE different between localhost and server

Hello, I was testing my application on my localhost, when I View Source, I see the __VIEWSTATE and its only small in size (about 500 bytes). When I copy this same...

__VIEWSTATE

Hi all, We have a problem here regarding this __VIEWSTATE data. CMS always keep data in viewstate and the data might be very big. Our search engine will only search for the...

__VIEWSTATE

I have a page, with an iframe in it. the iframe loads up another ASPX page, I have set both pages enableviewstate=false The problem is, if I click on anything on the main...


All times are GMT. The time now is 04:35 PM. | Privacy Policy