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

Problem with Page refresh for Treeview control

8 Answers 249 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rajesh Aggarwal
Top achievements
Rank 1
Rajesh Aggarwal asked on 14 Apr 2009, 01:38 PM
We are having a problem with the RadTreeView control.  After creating an Event (it doesn't matter if its just a single or a recurring event...), when you refresh the page, another event is created... basically a duplicate of what you just created. 

I wonder if this is a bug or am just missing something (i.e., needs to declare something, etc...).  Below are the step-by-step detail in recreating the issue:

1.  Invoke a treeview event such as add / remove node on server side.
2.  Click on the browser's "Page Refresh" button or "F5"... you will notice that a duplicate event is created.

What should we do to prevent this issue from happening?

Thanks for your help.

8 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Apr 2009, 01:50 PM
Hello Rajesh Aggarwal,

I am confused which control are you using. You are speaking of RadTreeView but then you mention recurring events which are part of RadScheduler.

When you hit the refresh button after a postback (HTTP post request) the last request is resubmitted. This means that the form is posted again which effectively redoes the previous action. The most commonly used workaround is to ajaxify the page so there are no postbacks.

Regards,
Albert
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
Rajesh Aggarwal
Top achievements
Rank 1
answered on 14 Apr 2009, 01:56 PM
I am using RadTreeview and RadGrid controls. Ignore the Scheduler part of it because I cut and paste from an earlier post. I am doing add / remove /rename nodes on the Treeview control and drag-and-drip grid rows to the tree. If I refresh the page then the previous event gets fired on page reload. How can I prevent that. Can you give me an exmple of how I can achieve this with ajax?
Thanks.
0
Atanas Korchev
Telerik team
answered on 14 Apr 2009, 02:01 PM
Hello Rajesh Aggarwal,

You can use RadAjaxPanel or RadAjaxManager in order to ajaxify your application. To do a test just wrap your controls inside a RadAjaxPanel control:

<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
       <telerik:RadTreeView runat="server" ID="RadTreeView1" />
</telerik:RadAjaxPanel>

Greetings,
Albert
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
Rajesh Aggarwal
Top achievements
Rank 1
answered on 14 Apr 2009, 02:29 PM
I have put a RadAjaxPanel around my RadTreeview and RadGrid controls. This seems to solve the problem of page refresh. However when I try to invoke another event after the first one I am getting "Invalid JSON primitive" error. How can I resolve that?
Thanks,
0
Atanas Korchev
Telerik team
answered on 14 Apr 2009, 04:21 PM
Hello Rajesh Aggarwal,

We are not sure why this error may occur. Please open a support ticket and send us a runnable version of your page which demonstrates the JavaScript error. Thanks.

Regards,
Albert
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
Rajesh Aggarwal
Top achievements
Rank 1
answered on 14 Apr 2009, 04:23 PM
Can you give me an example of how I can use RadAjaxManager? Do I put both RadTreeView and RadGrid inside RadAjaxManager wrapper?
Thanks,
0
Atanas Korchev
Telerik team
answered on 14 Apr 2009, 04:30 PM
Hello Rajesh Aggarwal,

Please check this help article which demonstrates how to ajaxify controls with RadAjaxManager. Here is a sample declaration which shows how to ajaxify RadTreeView and RadGrid:

        <telerik:RadAjaxManager runat="server" ID="RadAjaxMAnager1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>               
            </AjaxSettings>
        </telerik:RadAjaxManager>

Greetings,
Albert
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
Rajesh Aggarwal
Top achievements
Rank 1
answered on 15 Apr 2009, 04:36 PM
Thanks. That solved my problem.
-rajesh
Tags
TreeView
Asked by
Rajesh Aggarwal
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Rajesh Aggarwal
Top achievements
Rank 1
Share this question
or