PDA

View Full Version : Viewstate error


campustours
06-03-2009, 08:20 AM
I have one discountasp web site running fine at www.CampusTours.com (http://www.CampusTours.com), and I am trying to set up an identical copy of the site that draws from the same database at www.CampusMaps.info (http://www.CampusMaps.info) (both sites and the db are hosted at discountasp). Unfortunately, when I submit a search on www.CampusMaps.info (http://www.CampusMaps.info) it throws a viewstate error. I cannot figure out how to get this error to go away, despite the fact that the sites are identical. Anyone haveany thoughts?

bruce
06-03-2009, 11:01 AM
what is the error?

campustours
06-03-2009, 01:03 PM
you can replicate this by typing anything into the search box on www.campusmaps.info (http://www.campusmaps.info):



Server Error in '/' Application.

The state information is invalid for this page and might be corrupted.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:

[ArgumentException: The serialized data is invalid.] System.Web.UI.ObjectStateFormatter.Deserialize(Str eam inputStream) +199 System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +291 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() +113[ViewStateException: Invalid viewstate. Client IP: 67.244.194.229 Port: 58185 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6; SU 3.011; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506) ViewState: 28C513C913692F61CAF2740E7E187A8709EBE9987CA5D18D Referer: http://www.campusmaps.info/ Path: /searchList/results.aspx][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) +106 System.Web.UI.ViewStateException.ThrowViewStateErr or(Exception inner, String persistedState) +14 System.Web.UI.HiddenFieldPageStatePersister.Load() +217 System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +105 System.Web.UI.Page.LoadAllState() +43 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 System.Web.UI.Page.ProcessRequest() +80 System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.searchlist_results_aspx.ProcessRequest(HttpCon text context) +37 System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +75

Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

wisemx
06-03-2009, 03:32 PM
Hi,
Can you get someone local to you to look over your code?
I couldn't find anything on that site working properly, not even the static images are loading.
Salute,
Mark

bruce
06-08-2009, 11:04 AM
i notice that www.CampusTours.com and www.campusmaps.info have different ASP.NET Framework setting.

CampusTours.com = version 1.1
campusmaps.info = version 2.0

I am not sure what version of the framework was your application created on though.