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

Change of Label in Master Page accoding to User Control in Child Page.

3 Answers 38 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Dev D
Top achievements
Rank 2
Dev D asked on 26 Feb 2009, 08:20 PM

Hello Telerik Team,

I have one problem with Rad AJAX.

In my application I am using Master Page. And there is a label to print the name of the member selected.

Now, member is selected from a User control on each page having the above master pages. So accoriding to the member selected from the User Control,
the label Text at the top of Master page should be changed. But it is not happening.

Can you tell me what could be the problem??

The sceneraio is like this

<MASTER [Member Name]>
         <ASPX PAGE>
              <USER CONTROL>
                   <Member Name>
              </ USER CONTROL>
         </ ASPX PAGE>
</ MASTER>

So when the Member name changes in user control, the Member name (ie Label) should also change. This is done when the whole page is refreshed, but as I am using AJAX in my ASPX page, the page is not getting refreshed.

How can I solve this?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 02 Mar 2009, 05:22 PM
Hello Shailendrasinh,

You can either wrap the entire contents using RadAjaxPanel.or use  RadAjaxManager and specify the settings as shown in the documentation.

For more information on this matter you could review the following articles:
RadAjax  and WebUserControls
MasterPages: ajaxify and update controls in master and content page

Sincerely yours,
Pavlina
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
William
Top achievements
Rank 1
answered on 30 Oct 2012, 07:25 PM
It sure would be nice if we could have a code example of what Dev D is talking about.

An example would be a Shopping Cart total in the form of a label in a Master Page.

Now your content page would have a user control that contained a datalist with "Add To Cart" buttons. When you enter a quantity and hit the datalist item button, it should update the label on the Master Page but I'll be darned if I can find an example where you bubble up from user control to content page to Master page. And yes, I have gone through all the demos and online documentation. Seems like this should be a fairly common occurrence.
0
Pavlina
Telerik team
answered on 05 Nov 2012, 08:32 AM
Hi William,

In order to achieve the required functionality you could simply access the userControls's button on the master page and add ajax settings programmatically in which the mentioned button updates the label control. I am also attaching a sample runnable project which demonstrates a similar functionality.

All the best,
Pavlina
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.
Tags
Ajax
Asked by
Dev D
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
William
Top achievements
Rank 1
Share this question
or