Invalid JSON Primitive RadDock

8 posts, 0 answers
  1. Paul
    Paul avatar
    2 posts
    Member since:
    Jun 2008

    Posted 18 Jun 2008 Link to this post

    I have an evaluation version of the RadControls for ASP.NET AJAX v 2008.1.515.20

    I have a simple page with a button that does a postback, and toggles a RadDock's Closed property.

    The button is registered in the AjaxManager, and the updated controls is set to the RadDock itself.

    After clicking the button several times to show / hide the RadDock, I get the following error:

    Invalid JSON primitive:

    Any help?

    Here is the ASPX Markup:


    @ Page Language="C#" AutoEventWireup="true" Theme="Oracle" Codebehind="PopupTest.aspx.cs"


    Inherits="PasWbApp.UserControls.PopupTest" %>


    @ Register Src="../UserControls/AsActivityPopup.ascx" TagName="AsActivityPopup"


    TagPrefix="adminServerPas" %>


    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>



    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">


    html xmlns="">


    head id="Head1" runat="server">


    <title>Untitled Page</title>




    body style="background-color: #ffffff">


    <form id="form1" runat="server">


    <telerik:RadScriptManager ID="MasterScriptManager" runat="server">




    <asp:ScriptReference name="" Assembly="" Path="~/Lib/Java/ScrollToAnchor.js" />






    <telerik:RadAjaxManager ID="MasterAjaxManager" runat="server" EnableAJAX="true" DefaultLoadingPanelID="MasterAjaxLoadingPanel"


    ClientEvents-OnRequestStart="centerUpdatePanel();" RequestQueueSize="5">




    <telerik:AjaxSetting AjaxControlID="PopupToggleButton">




    <telerik:AjaxUpdatedControl ControlID="PopupWindow" />










    <telerik:RadStyleSheetManager ID="MasterStyleSheetManager" runat="server">




    <telerik:RadAjaxLoadingPanel ID="MasterAjaxLoadingPanel" runat="server" Height="100%"


    Width="100%" IsSticky="true" BackColor="White">


    <img id="MasterAjaxLoadingPanelImage" alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'


    style="border: 0px;" />


    <div id="MasterAjaxLoadingPanelBackground">






    <telerik:RadScriptBlock runat="server" ID="CenterLoadingPanelScriptBlock">


    <script language="javascript" type="text/javascript">


    function centerUpdatePanel()





    function centerElementOnScreen(element)


    var scrollTop = document.body.scrollTop;

    var scrollLeft = document.body.scrollLeft;

    var viewPortHeight = document.body.clientHeight;

    var viewPortWidth = document.body.clientWidth;

    if (document.compatMode == "CSS1Compat")


    viewPortHeight = document.documentElement.clientHeight;

    viewPortWidth = document.documentElement.clientWidth;

    scrollTop = document.documentElement.scrollTop;

    scrollLeft = document.documentElement.scrollLeft;


    var topOffset = Math.ceil(viewPortHeight/2 - element.offsetHeight/2);

    var leftOffset = Math.ceil(viewPortWidth/2 - element.offsetWidth/2);

    var top = scrollTop + topOffset - 40;

    var left = scrollLeft + leftOffset - 70; =

    "fixed"; = 30000;

    // set the opacity...

  = .7; =


    // = top + "px";


    // = left + "px";

  = 0; = 0; = viewPortWidth; = viewPortHeight;

    var imgElement = document.getElementById('MasterAjaxLoadingPanelImage'); =

    "fixed"; = top +

    "px"; = left +

    "px"; = 1; =

    'alpha(opacity=100)'; = 40000;








    <asp:Button runat="server" ID="PopupToggleButton" Text="Toggle Popup" />


    <br />


    <telerik:RadDockLayout runat="server" ID="DockLayout">


    <telerik:RadDock runat="server" ID="PopupWindow" DockMode="Floating" Pinned="false"


    Closed="true" Collapsed="false" Height="520" Width="780">




    Hello There!















    protected void Page_Load( object sender, EventArgs e ) {

    this.PopupToggleButton.Click += new EventHandler( PopupToggleButton_Click );


    protected void PopupToggleButton_Click( object sender, EventArgs e ) {

    if( PopupWindow.Closed ) {

    PopupWindow.Closed =



    else {

    PopupWindow.Closed =




  2. Paul
    Paul avatar
    4 posts
    Member since:
    Dec 2007

    Posted 19 Jun 2008 Link to this post

    More Due Dilligence here, but the JSON error only happens if you drag around the window.

    If you simply close the window, hit the toggle button to open it from the postback, and close the window without moving it, I do not get the error.  If you drag the window, then you will get the error eventually.
  3. Paul
    Paul avatar
    4 posts
    Member since:
    Dec 2007

    Posted 20 Jun 2008 Link to this post

    I know everyone is chomping at the bit for an answer here.

    I was able to workaround the issue ( even though it is still open IMHO ).

    Basically, I removed the RadDock itself from being ajaxified, so I cannot change the properites of a RadDock in the code behind and have it open or close.

    You CAN however ajaxify the contents of the RadDock, which is more important.

    I generate a ResponseScript on the AjaxManager to show / hide the raddock as a popup client side when I need to.

    I'll leave this open for the time being to see if anyone from Telerik can chime in.

  4. Petio Petkov
    Petio Petkov avatar
    825 posts

    Posted 23 Jun 2008 Link to this post

    Hello Paul,

    The problem you experience is due to that you update a floating RadDock with AJAX. When dragging the dock you move it outside the update panel and this causes AJAX not working properly as it attempts to recreate the dock at the place it was previously located and  the dock is moved at the new place and stays there. In 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. Improving  the ability of RadDock to work with AJAX and simplifying the whole mechanism is in our TODO list for the next official release. For the time being I suggest that you update the content.

    Let us know if you have any other questions.

    Best regards,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Shani
    Shani avatar
    1 posts
    Member since:
    May 2011

    Posted 23 May 2011 Link to this post


    I have the same problem as describe here,
    i didn't understand exactly what you meant by saying:
    " For the time being I suggest that you update the content"
    how can i solve the problem?

    Thanks a lot,
  6. Pero
    Pero avatar
    1156 posts

    Posted 25 May 2011 Link to this post

    Hello Shani,

    Instead of ajaxifying the dock itself, you should ajaxify its content. For example, placing the RadDock's content
    inside an UpdatePanel would ajaxify the dock's child controls, and you could move the dock anywhere on the page without any problems.

    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. Geoffrey
    Geoffrey avatar
    3 posts
    Member since:
    Dec 2010

    Posted 09 Jun 2011 Link to this post

    Jun 23, 2008 you posted that this was on the TODO list for the next release. Has this been addressed?

    I have a page that is meant as a search-type page. On the page is multiple rad-docks filled with different types of
    search results. They can be filled, and all of the content within each dock works fine (dock content is within an
    update panel). But the second you move anything, then search again the page blows up.
    Has there been a fix?
  8. Pero
    Pero avatar
    1156 posts

    Posted 13 Jun 2011 Link to this post

    Hello Geoff,

    Is any of the floating docks placed in an Ajax Panel? If yes please make sure only the RadDock's content is ajaxified.
    We tried to improve the way the floating docks are ajaxified, but we couldn't change anything because it meant tying the RadDock to an HTML different than the <form/> element, which introduced additional problems. On the other hand we can't ajaxify the entire <form/>, because this will undermine the entire purpose of the Ajax framework - to update only part of the page, and not the entire content.
    So, the only way to ajaxify a RadDock control is either by keeping the dock docked to ajaxified zone or ajaxifying the content.

    Kind regards,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top