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

How-To Question: Control that starts AJAX Request is on Master, but Control that will be updated is on another Page

2 Answers 49 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mallory
Top achievements
Rank 1
Mallory asked on 09 Mar 2010, 01:38 PM
Hey everyone

I have the following scenario: The Master page contains a RadAjaxManager (ID = ajaxMgr) and a RadTreeView (ID = treeView). On another page, namely Default.aspx a RadGrid (ID = radGrid) is placed. The treeView will start the AJAX request and the radGrid is the control that will be updated. My question here is, on which page do I add the AJAX setting: on the Master page (using a base class or something else) or on the Default.aspx page (using ((MasterPage)Master).AjaxMgr.AjaxSettings.AddAjaxSettings(((MasterPage)Master).TreeView, radGrid) )? Does a Telerik control exist, that does solve this kind of situation? Or what is your best practice in this scenario? 

I'm looking forward to your answers. Thanks.

Regards,
Mallory

2 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 09 Mar 2010, 04:08 PM
I believe this help article should be of use to you.


Ignore the code they show for the master page, since I doubt it applies to your situation, and look at the content page code. You just need to get the TreeView control from the master page and then create an AjaxSetting that updates the grid control in your content page.

I hope that helps.
0
Mallory
Top achievements
Rank 1
answered on 10 Mar 2010, 08:05 AM
Hi robertw102

Thanks for your reply and the link. The linked approach looks good, but it looks like there's no optimal solution to my scenario. I thought to ask this question, because I always get a specific error (see this forum post of mine describing the problem) if I work with ((MasterPage)Master).AjaxMgr.AjaxSettings.AddAjaxSettings(((MasterPage)Master).TreeView, radGrid) . The thing is that the RadTreeView has to be displayed on every content page. If I place the RadTreeView on each content page (a content page in my case also contains the RadGrid), the problem disappears, but another arises: I have to duplicate the RadTreeView (which remains the same over all content pages) on all the content pages, and that's actually not that beautiful. This question only arised because of the abovementione (and linked) problem I'm having right now with the AjaxManager. Long story short, I'm going to give the linked approach a try and see if it solves my problem. Again, thanks for your reply.

Regards,
Mallory
Tags
Ajax
Asked by
Mallory
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
Mallory
Top achievements
Rank 1
Share this question
or