Getting at a specific menu item programatically

3 posts, 0 answers
  1. Darren
    Darren avatar
    14 posts
    Member since:
    Sep 2012

    Posted 01 May 2012 Link to this post

    One of my menu items serves as a login/logout button. I need to change the text of this menu item based on if they are logged in or out. I noticed there are no individual id's on each of the menu items. How do I get at the menu item without using ordinal positions or writing traversing code? Thanks guys!
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 May 2012 Link to this post

    Hello,

    You can check for the condition and change the text as shown below.
    C#:
    if(some condition)
     {
      RadMenuItem item=   RadMenu1.FindItemByText("Login");
      item.Text = "Logout";
     }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Darren
    Darren avatar
    14 posts
    Member since:
    Sep 2012

    Posted 02 May 2012 Link to this post

    ah, ok. Thank you very much!
Back to Top