Visual Studio .NET - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException

Asked By kalpana s on 18-Oct-08 08:54 AM

I am loading user controls using webservices and ajax. In master page if i click any event I got an exception as

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException

Please Provide a solution for this

solution - Perry replied to kalpana s on 18-Oct-08 12:43 PM

Hi,

Please make sure that you are accessing master page variable like below:

- Ctype(master.findcontrol("label"),label).text ="Test"
- Ctype(master.findcontrol("updatepanelID"),updatepanel).update

Please double check whether you have added ScriptManager on your page or not.  In your situation, we suggest that you'd better remove the contents inside the ContentTemplate and the associated code on code behind, then have a test.  If it doesn't work, you shall check your system environments.

This is a generic error message. To see a helpful error add EnablePartialRendering="true" to your update panel tag, and set customErrors="Off" in your web.config. Then you should see a detailed description of what's wrong.

The exception can be also in the aspx markup (in <%= , or in <%# code blocks). This is easily be detected for the first request (you get the general exception page), but for partial postbacks this is harder.If you put a break point in code-behind, and use F10/F11, the debugger will step in also in the aspx markup.For example, just put a break-point in a late event like OnPreRender (if you not have this event, just create it), when the break-point triggered press F11 until you reach the aspx/ascx markup.

Regards,
Megha

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

kalpana s replied to Perry on 20-Oct-08 12:21 AM
 

Server Error in '/ASP.NETWithAjax2-CS' 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:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\asp.netwithajax2-cs\715030f3\a9b55891\App_Web_n_3yawkl.0.cs    Line: 0

Stack Trace:

[FormatException: Invalid character in a Base-64 string.]
   System.Convert.FromBase64String(String s) +0
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +67
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
   System.Web.UI.HiddenFieldPageStatePersister.Load() +136
[ViewStateException: Invalid viewstate. 
	Client IP: 127.0.0.1
	Port: 
	User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; IEMB3; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; IEMB3)
	ViewState: /wEPDwUJNzI0NzAzNzgyZGRVEntFixZzVJY+7hgAx6Es6vt71g==,/wEPDwUBMA9kFgJmD2QWAmYPZBYCAgEPPCsADQEADxYEHgtfIURhdGFCb3VuZGceC18hSXRlbUNvdW50AskDZBYCZg9kFpQHAgEPZBYQZg8PFgIeBFRleHQFBTEwMjQ4ZGQCAQ8PFgIfAgUOUXVlc28gQ2FicmFsZXNkZAICDw8WAh8CBQcxNC4wMDAwZGQCAw8PFgIfAgUBMGRkAgQPDxYCHwIFAjEyZGQCBQ8PFgIfAgUSQWNjb3VudGluZyBNYW5hZ2VyZGQCBg8PFgIfAgUMUGF1bCBIZW5yaW90ZGQCBw8PFgIfAgUZVmlucyBldCBhbGNvb2xzIENoZXZhbGllcmRkAgIPZBYQZg8PFgIfAgUFMTAyNDhkZAIBDw8WAh8CBR1TaW5nYXBvcmVhbiBIb2traWVuIEZyaWVkIE1lZWRkAgIPDxYCHwIFBjkuODAwMGRkAgMPDxYCHwIFATBkZAIEDw8WAh8CBQIxMGRkAgUPDxYCHwIFEkFjY291bnRpbmcgTWFuYWdlcmRkAgYPDxYCHwIFDFBhdWwgSGVucmlvdGRkAgcPDxYCHwIFGVZpbnMgZXQgYWxjb29scyBDaGV2YWxpZXJkZAIDD2QWEGYPDxYCHwIFBTEwMjQ4ZGQCAQ8PFgIfAgUWTW96emFyZWxsYSBkaSBHaW92YW5uaWRkAgIPDxYCHwIFBzM0LjgwMDBkZAIDDw8WAh8CBQEwZGQCBA8PFgIfAgUBNWRkAgUPDxYCHwIFEkFjY291bnRpbmcgTWF...]
[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +267
   System.Web.UI.HiddenFieldPageStatePersister.Load() +218
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
   System.Web.UI.Page.LoadAllState() +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
   System.Web.UI.Page.ProcessRequest() +86
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\asp.netwithajax2-cs\715030f3\a9b55891\App_Web_n_3yawkl.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64



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


I am calling the usercontrol through webservices using ajax, after loading the usercontrol if i onclick the button i got this above error.

Please Provide soultion for this

by

kalpana


solution - Perry replied to kalpana s on 20-Oct-08 12:48 AM

This error occures in below scenarios:

1. The page that you want to submit is a main page and through AJAX you got some
content from another page but with the returned content. It's contained a
variable name say "__VIEWSTATE". It will replaced the same variable of the main
page.when you try to submit the content of main page. The error you mentioned
will comes. Because the content of __VIEWSTATE of main page is replaced
already.

There are two solutions for this:
The first is to chagne the Ajax page to HTML form and HTML controls.
Another solutions is to move all the elements from Ajax page to main page.

2.  Browsers that cannot support hidden fields very well - http://support.microsoft.com/kb/831150
3. Small numbers - http://support.microsoft.com/kb/812399
4. Your viewstate is too big. Some browsers can't handle that
5. There is some network error. The viewstate information was corrupted on the way, but I doubt it in your case cos problem only exists with Opera
6. If hosted on a web farm http://support.microsoft.com/default.aspx?scid=kb;EN-US;323744
Also have a look at this, u may find some info in there to help you
http://aspalliance.com/articleViewer.aspx?aId=72&pId=

Regards,
Megha
re - Web Star replied to kalpana s on 20-Oct-08 12:50 AM

CAUSE

loadTOCNode(1, 'cause');
This problem occurs because the .NET Framework converts small numbers in the View State to Scientific Notation. When the .NET Framework tries to deserialize the number, it cannot recognize the number or the number is not the expected data format.

http://support.microsoft.com/kb/812399#top

RESOLUTION

loadTOCNode(1, 'resolution');
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework 1.0 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support (http://support.microsoft.com/contactus/?ws=support)
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
http://support.microsoft.com/kb/812399
read this link - C_A P replied to kalpana s on 20-Oct-08 01:36 AM
http://tesms.blogspot.com/2008/10/syswebformspagerequestmanagerservererro.html
http://forums.infragistics.com/forums/p/11144/42240.aspx