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

1 master page 2 usercontrols

1 Answer 56 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
stevied
Top achievements
Rank 2
stevied asked on 23 Feb 2011, 06:18 PM
I have a master page (nested although i dont think this is relavent) and within tha page i have 2 usercontrols (a header file and quick login panel).

In the header usercontrol i have a hyperlink to register which i want to change when the user logs in to myaccount.

I have wrapped the hyperlink in a radajaxpanel as follows

<li><Telerik:RadAjaxPanel ID="rapHypRegister" runat="server" ><asp:HyperLink ID="hypUtilNavRegister" runat="server" Text="Register" ToolTip="Register" NavigateUrl="~/register.aspx" /></Telerik:RadAjaxPanel></li>


and also ALL my code for the login usercontrol (rapLogin).  I am using the following radajax manager

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
               <AjaxSettings>
                   <telerik:AjaxSetting AjaxControlID="rapLogin">
                       <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="rapLogin" LoadingPanelID="RadAjaxLoadingPanel1" />
                           <telerik:AjaxUpdatedControl ControlID="rapHypRegister"  />
                       </UpdatedControls>
                   </telerik:AjaxSetting>
          </AjaxSettings>
      </telerik:RadAjaxManager>


On the login user control, once the login code is finished I am referncing the header control with a view to changing the text and navigate link as follows.

'Now we need to change the register text in the header usercontrol
               'Lets find the usercontrol
               Dim MyControl As Control = Me.Page.Master.Master.FindControl("header1")
               'Now we need the update panel from the header usercontrol
               'Dim radRegUpdatePanel As RadAjaxPanel = MyControl.FindControl("rapRegister")
               'Now we can access the hyperlink
               Dim hypMyregLink As HyperLink = MyControl.FindControl("hypUtilNavRegister")
               hypMyregLink.Text = "My Account"
               hypMyregLink.NavigateUrl = "~/myaccount.aspx"


This is not happening...if if remove all the radajaxpanels then the hyperlink gets updated as it should. Am i missing something?

I should point out when the radajaxpanel is in place they both get the animation and "look" like its working but by text does not change.

Many thanks,

Stephen

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 28 Feb 2011, 03:18 PM
Hi,

First, you should not wrap content updated by RadAjaxManager with a RadAjaxPanel. You can replace the RadAjaxPanel with a regular asp Panel. Also, the login form should not be residing in a RadAjaxPanel (I assumed that this is so from the way you named it).

If after you remove the RadAjaxPanels, the issue persists, please, paste the mark-up of the login form as well, since the problem may also be caused by incorrect ajax settings.

Regards,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Ajax
Asked by
stevied
Top achievements
Rank 2
Answers by
Tsvetina
Telerik team
Share this question
or