2

I'm using VS2010/C#, how can I change ASP.NET menu item navigate URL property in code behind? it seems that ASP:MENU items don't have any ID, so how can I access them in codebehind?

thanks

2
  • on which event you have to do this Commented Oct 20, 2011 at 6:22
  • what do you mean exactly by event? I just want to change ASP:MENUITEM navigate url in codebehind, of course I'v seen menu item onclick event but I think it's better to change navigate url, is it possible at all? can I set ID and runat=server for menu items? Commented Oct 20, 2011 at 6:25

1 Answer 1

3
Menu1.Items[0].NavigateUrl = "http:stackoverflow.com";

menu is a collection of items so you can use indexing for access any particular item in menu

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.