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

Getting at a specific menu item programatically

2 Answers 53 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 2
Darren asked on 01 May 2012, 06:29 PM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 May 2012, 05:42 AM
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.
0
Darren
Top achievements
Rank 2
answered on 02 May 2012, 05:46 PM
ah, ok. Thank you very much!
Tags
Menu
Asked by
Darren
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Darren
Top achievements
Rank 2
Share this question
or