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

Invalid JSON primitive after Q1 2013 install

6 Answers 98 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 18 Apr 2013, 07:55 AM
Hi

One of my websites had radgrids and radtrees to display data.  When the user clicks a row a RadDock windo appears with the data in it.  All worked fine until the 2013 Q1 upgrade.  Now on the second load I get an Invalid JSON primitive error (as below)

Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":50,"Left":225,"DockZoneID":"","Collapsed":false,"Pinned":true,"Resizable":false,"Closed":false,"Width":"821px","Height":null,"ExpandedHeight":0,"Index":-1,"IsDragged":false}.

If I put the RadDock in a RadDockZone it doesn't have the error however it renders inline with the page instead of as a floating window.

Any suggestions on what has happened and why this happens on the 2nd load rather than the first?

Regards

Jon


6 Answers, 1 is accepted

Sort by
0
Jon
Top achievements
Rank 1
answered on 18 Apr 2013, 08:15 AM
Working on this some more I've stripped out all but a button to open the dock and the dock itself.  Code is attached below,m  click the Open button, then in the doc the close button.  On the next press of the Open button the error appears...

Partial Public Class Test
    Inherits System.Web.UI.Page
 
    Public Sub UxRadAjaxManager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles uxRadAjaxManager.AjaxRequest
        ' Open the form popup
        uxRadDockViewPane.Closed = False
    End Sub
End Class

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadStyleSheetManager ID="pgRadStyleSheetManager" runat="server"></telerik:RadStyleSheetManager>
        <telerik:RadScriptManager ID="pgRadScriptManager" runat="server"></telerik:RadScriptManager>
        <telerik:RadDock ID="uxRadDockViewPane" runat="server" Width="400px" Top="50px"
            EnableRoundedCorners="false" Pinned="true" Title="Event Details"
            EnableAnimation="false" AutoPostBack="false" Resizable="false" DefaultCommands="Close" EnableDrag="False" Index="-1"
            Tag="" Closed="True">
            <ContentTemplate>
                Test
                <telerik:RadButton ID="uxCloseViewPopup" Text="Close" UseSubmitBehavior="false" AutoPostBack="false" OnClientClicking="CloseRadDocFromButton"
                    runat="server" CausesValidation="False" CommandName="Cancel">
                </telerik:RadButton>
            </ContentTemplate>
        </telerik:RadDock>
        <telerik:RadButton ID="RadButton1" Text="Open" UseSubmitBehavior="false" AutoPostBack="false"
            OnClientClicking="ShowPopup"
            runat="server" CausesValidation="False" CommandName="Cancel" >
        </telerik:RadButton>
        <telerik:RadAjaxManager ID="uxRadAjaxManager" runat="server" >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="uxRadAjaxManager">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="uxRadDockViewPane"  />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadFormDecorator ID="pgRadFormDecorator" Runat="server" DecoratedControls="Scrollbars" ></telerik:RadFormDecorator>
        <script type="text/javascript">
            function ShowPopup() {
                var ajaxManager = $find('uxRadAjaxManager');
                ajaxManager.ajaxRequest("DisplayViewForm,1");
            }
 
            function CloseRadDocFromButton(sender, eventArgs) {
                $find('uxRadDockViewPane').set_closed(true);
            }
        </script>
    </form>
</body>
</html>
0
Slav
Telerik team
answered on 22 Apr 2013, 03:22 PM
Hi Jon,

Please check the help article Placing a RadDock in an UpdatePanel. Such a setup is not supported because a floating RadDock is moved in the DOM of the page and it gets out of the boundaries of the UpdatePanel that wraps it. Previously this behavior was examined in certain cases, because the dock was moved outside the update panel only while being dragged.

Recently the dock control was updated in order to improve its behavior in a floating state. It is now always rendered as a direct child of the form tag, which causes the problem described above every time you update a floating dock.

The suggested approach in this case is to use the client-side API of RadDock (function set_closed()) in order to open a dock that is initially closed (its property Closed is set to true). You can still Ajaxify its content as shown in the help article that I linked above.

I hope this helps. Feel free to contact us again if you run into more difficulties.
 
All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jon
Top achievements
Rank 1
answered on 23 Apr 2013, 09:49 AM
Hi Slav,

I pretty much was using the set_closed and have modified the response scripts from the ajax call to call it rather than setting the uxRadDockViewPane.Closed = False to open it.  

I still have the problem though.  First load the window is fine, second load of the window after closing it I get the error.

Would you mind using the code that I submitted to generate a sample project for me with a method that works?

Many thanks

Jon


0
Jon
Top achievements
Rank 1
answered on 25 Apr 2013, 02:18 PM
Hi again Slav,

Please get back to me with a working example.  In the example I need to be able to see that a popup is having it's content changed from the code behind in an ajax call.  I've been trying all kinds of things based on your advise and it still doesn't work.

Need this as soon as possible please

Regards

Jon
0
Accepted
Slav
Telerik team
answered on 25 Apr 2013, 04:09 PM
Hi Jon,

The attached sample project uses the RadDock control as an edit dialog for the RadScheduler. The setup of the dock in this demo is similar to the one I am suggesting so you can use it as a reference for configuring the control on your end.

Regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jon
Top achievements
Rank 1
answered on 26 Apr 2013, 08:35 AM
Hi Slav,

Many thanks that works now.  Although that said I'm not really sure what is different here to something I'd already tried with no success. 

But it's working now so I'm not complaining!

Best Regards

Jon
Tags
Dock
Asked by
Jon
Top achievements
Rank 1
Answers by
Jon
Top achievements
Rank 1
Slav
Telerik team
Share this question
or