1 master page 2 usercontrols

2 posts, 0 answers
  1. stevied
    stevied avatar
    37 posts
    Member since:
    Apr 2007

    Posted 23 Feb 2011 Link to this post

    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">
                       <telerik:AjaxSetting AjaxControlID="rapLogin">
                               <telerik:AjaxUpdatedControl ControlID="rapLogin" LoadingPanelID="RadAjaxLoadingPanel1" />
                               <telerik:AjaxUpdatedControl ControlID="rapHypRegister"  />

    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,

  2. Tsvetina
    Tsvetina avatar
    2481 posts

    Posted 28 Feb 2011 Link to this post


    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.

    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!
Back to Top