This is a migrated thread and some comments may be shown as answers.

Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive

2 Answers 310 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fergus Bown
Top achievements
Rank 1
Fergus Bown asked on 11 Feb 2009, 05:23 PM
I have a page with some RadDockZones and RadDocks. I have some buttons which, upon clicking user client and server side manipulation of the docks and zones.  Relatively easily it is possible to get the following error message:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":381,"Left":576,"DockZoneID":"","Collapsed":false,"Pinned":false,"Resizable":true,"Closed":false,"Width":"47%","Height":null,"ExpandedHeight":0,"Index":0}.

I have tried the AjaxManager request start/end fix as suggested in another post:

<

 

asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">

 

 

<telerik:RadAjaxManager runat="server" ID="RadAjaxManangerProject" DefaultLoadingPanelID="RadAjaxLoadingPanel1" RequestQueueSize="2">

 

 

<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />

 

 

</telerik:RadAjaxManager>

 

 

<script type="text/javascript">

 

 

var AjaxIsActive = false;

 

 

function RequestStart() {

 

 

if (!AjaxIsActive) {

 

AjaxIsActive =

true;

 

}

 

else {

 

alert(

'Wait for ajax to finish');

 

 

return false;

 

}

}

 

function ResponseEnd() {

 

AjaxIsActive =

false;

 

}

but it doesn't help.

ANy ideas?
Cheers

2 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 16 Feb 2009, 01:13 PM
Hello Fergus Bown,

We are familiar with this problem and it happens when you update a floating RadDock with AJAX. When dragging the dock you move it outside the update panel and this causes AJAX not to work properly as it attempts to recreate the dock at the place it was previously located. The dock however is moved to the new place and stays there. This way two docks with the same id appear on the page and this leads to an exception. This is a common problem of controls which can be moved in the DOM tree.

The RadDock for ASP.NET AJAX is not a standard control and if you want to update some of the objects via ajax you should update all RadDockZones while each RadDock is docked.
A simple example which demonstrates another approach to save the state of dynamically created RadDocks is available here:
 http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx

If you think that the problem you have is different from the described problem above, please create a simple running example, where we can observe the problem and provide us steps to reproduce it. Once we receive it we will do our best to help you.

Regards,
Petio Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
liju
Top achievements
Rank 1
answered on 16 Nov 2010, 05:34 AM
HTML code errors in the page also can result in this type of errors.
Tags
General Discussions
Asked by
Fergus Bown
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
liju
Top achievements
Rank 1
Share this question
or