I have a CustomGridControl that we created to add custom paging. It works fine in every instance except when we put it on an AJAX TabContainer.
Then we get the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value 'System.Object[]' of type 'System.Object[].'
The error happens right after this method returns when rendering the grid after a databind. I tried commenting out this method, but that had not impact on the exception. Please let me know if you have any additional questions.
I am not doing any of these 5 things from the first article. The link for the second article is broken. It looks like it is no longer in the blog archive.
<div>Calls to Response.Write():
By calling Response.Write() directly you are bypassing the normal rendering mechanism of ASP.NET controls. The bits you write are going straight out to the client without further processing (well, mostly...). This means that UpdatePanel can't encode the data
in its special format.</div>
<div>Response filters:
Similar to Response.Write(), response filters can change the rendering in such a way that the UpdatePanel won't know.</div>
<div>HttpModules:
Again, the same deal as Response.Write() and response filters.</div>
<div>Server trace is enabled:
If I were going to implement trace again, I'd do it differently. Trace is effectively written out using Response.Write(), and as such messes up the special format that we use for UpdatePanel.</div>
<div>Calls to Server.Transfer():
Unfortunately, there's no way to detect that Server.Transfer() was called. This means that UpdatePanel can't do anything intelligent when someone calls Server.Transfer(). The response sent back to the client is the HTML markup from the page to which you transferred.
Since its HTML and not the special format, it can't be parsed, and you get the error.</div>
If that doesn't help, please see whether you are using script manager or tool script manager and also check if you are using the tag prefix specified in the .aspx page.
In my code behind I have ScriptManager.RegisterStartupScript, but I don't have
<ajaxToolkit:ToolkitScriptManager in aspx. I have specified the tagprefix for my custom control in the aspx page and ajax controls in web.config.
If you only work with the Tabs at client side and do not mind using javascript libraries, you may give a try by jQuery UI's Tabs
http://jqueryui.com/demos/tabs/
It is straight forward that you can split your content in a couple of divs, and have bind them to jQuery's Tabs. It toggles these content shown/hidden for you.
You can try changing the script manager to ToolScriptManager once before trying anything else.
Also try to check the exact error in the status bar of the IE by double clicking on it when showing error so that you may get some clue which is causing the error.
creagan
Member
147 Points
41 Posts
PageRequestManagerServerErrorException on TabContainer
Apr 14, 2011 03:52 PM|LINK
I have a CustomGridControl that we created to add custom paging. It works fine in every instance except when we put it on an AJAX TabContainer.
Then we get the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value 'System.Object[]' of type 'System.Object[].'
We have this code in the CustomGridControl:
protected override object SaveControlState() { return new object[] { this.LastSortExpression, this.LastSortDirection, base.SaveControlState() }; }The error happens right after this method returns when rendering the grid after a databind. I tried commenting out this method, but that had not impact on the exception. Please let me know if you have any additional questions.
chetan.sarod...
All-Star
65789 Points
11153 Posts
Re: PageRequestManagerServerErrorException on TabContainer
Apr 15, 2011 02:55 AM|LINK
Hi, Please refer this
<div>http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
http://alpascual.com/blog/al/archive/2007/04/26/How-to-fix-Sys.WebForms.PageRequestManagerParserErrorException-in-AJAX.aspx
</div>Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
creagan
Member
147 Points
41 Posts
Re: PageRequestManagerServerErrorException on TabContainer
Apr 20, 2011 03:51 PM|LINK
I am not doing any of these 5 things from the first article. The link for the second article is broken. It looks like it is no longer in the blog archive.
By calling Response.Write() directly you are bypassing the normal rendering mechanism of ASP.NET controls. The bits you write are going straight out to the client without further processing (well, mostly...). This means that UpdatePanel can't encode the data in its special format.</div>
Similar to Response.Write(), response filters can change the rendering in such a way that the UpdatePanel won't know.</div>
Again, the same deal as Response.Write() and response filters.</div>
If I were going to implement trace again, I'd do it differently. Trace is effectively written out using Response.Write(), and as such messes up the special format that we use for UpdatePanel.</div>
Unfortunately, there's no way to detect that Server.Transfer() was called. This means that UpdatePanel can't do anything intelligent when someone calls Server.Transfer(). The response sent back to the client is the HTML markup from the page to which you transferred. Since its HTML and not the special format, it can't be parsed, and you get the error.</div>
swapna.anu
Contributor
2658 Points
745 Posts
Re: PageRequestManagerServerErrorException on TabContainer
Apr 20, 2011 04:03 PM|LINK
Hi
Please see the below link
http://forums.asp.net/t/1588730.aspx/1
If that doesn't help, please see whether you are using script manager or tool script manager and also check if you are using the tag prefix specified in the .aspx page.
Hope this helps.
Thanks
creagan
Member
147 Points
41 Posts
Re: PageRequestManagerServerErrorException on TabContainer
Apr 20, 2011 05:27 PM|LINK
In my code behind I have ScriptManager.RegisterStartupScript, but I don't have <ajaxToolkit:ToolkitScriptManager in aspx. I have specified the tagprefix for my custom control in the aspx page and ajax controls in web.config.
BU XI - MSFT
All-Star
22367 Points
2704 Posts
Microsoft
Re: PageRequestManagerServerErrorException on TabContainer
Apr 21, 2011 02:18 AM|LINK
Hello
If you only work with the Tabs at client side and do not mind using javascript libraries, you may give a try by jQuery UI's Tabs http://jqueryui.com/demos/tabs/
It is straight forward that you can split your content in a couple of divs, and have bind them to jQuery's Tabs. It toggles these content shown/hidden for you.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
swapna.anu
Contributor
2658 Points
745 Posts
Re: PageRequestManagerServerErrorException on TabContainer
Apr 21, 2011 08:08 AM|LINK
Hi,
You can try changing the script manager to ToolScriptManager once before trying anything else.
Also try to check the exact error in the status bar of the IE by double clicking on it when showing error so that you may get some clue which is causing the error.
Hope this helps.