RadMenuItem set to different pages

2 posts, 0 answers
  1. Robin
    Robin avatar
    9 posts
    Member since:
    Sep 2015

    Posted 06 Sep Link to this post

    I have a radmenu and one of the radmenuitems needs to be set to differernt pages depending on session variable.  The other menuitems are static. 

    I have tried navigateurl='<%# session("pageid")%>

    The first menuitem is the one I want to be dynamic

     

    here is my radmenu code

     <telerik:RadMenu runat="server" ID="radMenu2" Style="vertical-align:middle; width: 74%; margin: 0 auto;padding-right:5px; padding-bottom: 15px; padding-top: 10px;"  RenderMode="Lightweight"  >
                      <Items>
                          <telerik:RadMenuItem runat="server" Text="Letter of Intent/Proposal" Font-Names="Trebuchet MS" Font-Size="12pt" navigateurl='<%#Session("pageName") %>'></telerik:RadMenuItem>
                          <telerik:Radmenuitem text ="Letter of Intent/Proposal"  font-size="12pt" Font-Names="Trebuchet MS" runat="server"
               enabled="true" >
                    </telerik:Radmenuitem>
              <telerik:Radmenuitem text ="Third Party Information" font-size="12pt" Font-Names="Trebuchet MS" runat="server"
               >
                    </telerik:Radmenuitem>
                       <telerik:radmenuitem text="Essentials" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/essentialinfo.aspx"></telerik:radmenuitem>
                     
                    <telerik:radmenuitem text="Focus" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/focus.aspx"></telerik:radmenuitem>
                  
                    <telerik:radmenuitem text="Award Design" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/awardDesign.aspx"></telerik:radmenuitem>
                   <telerik:radmenuitem text="Student Support" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/studentsupport.aspx"></telerik:radmenuitem>

                    <telerik:radmenuitem text="Narrative" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/Narrative.aspx"></telerik:radmenuitem>
                    
                    <telerik:radmenuitem text="Invoice Schedule" runat="server" font-size="12pt" Font-Names="Trebuchet MS"  navigateurl="/mssApplications/invoiceSchedule.aspx"></telerik:radmenuitem>
                    
                    <telerik:radmenuitem text="Grant Documents" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/grantdocuments.aspx"></telerik:radmenuitem>
                    </items>
                    </telerik:radmenu>

     

    Thank you

  2. Eyup
    Admin
    Eyup avatar
    3801 posts

    Posted 11 Sep Link to this post

    Hello Robin,

    This syntax is a databinding-expression and it will work only when the RadMenu is bound, for instance:
    protected void Page_Load(object sender, EventArgs e)
    {
        radMenu2.DataBind();
    }

    Alternatively, you can traverse the existing RadMenu items in the PreRender event and change the NavigateUrl programmatically. The traversing can happen either by using the radMenu2.Items collection or FindItemByText or FindItemByValue.

    That should resolve the issue. Feel free to give it a try and let me know about the result. 

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top