Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 20, 2012 08:09 PM by london24
Member
97 Points
108 Posts
Feb 20, 2012 12:00 PM|LINK
Hi
How can I use the navigateurl of the menuitem with routing?
I've tried using an index or referencing the specific menuitem but no luck.
I am not populating the menuitems from a table.
Thanks for any help.
NavigationMenu.Items(8).NavigateUrl = Page.GetRouteUrl("New", ViewState("AccountId"))
NavigationMenu.FindItem("New").NavigateUrl = Page.GetRouteUrl("New", ViewState("AccountId"))
Feb 20, 2012 07:35 PM|LINK
If the menu cannot be used with routing, can anyone suggest a good alternative please?
I am using asp.net v4.0 (VS 2010)
Thanks
Feb 20, 2012 08:09 PM|LINK
Ok seems to be working now just using this in the code:
NavigationMenu.Items(0).NavigateUrl = Page.GetRouteUrl("Home", ViewState("AccountId"))
NavigationMenu.Items(1).NavigateUrl = Page.GetRouteUrl("MyProfile", ViewState("AccountId"))
etc
london24
Member
97 Points
108 Posts
asp:menu and routing
Feb 20, 2012 12:00 PM|LINK
Hi
How can I use the navigateurl of the menuitem with routing?
I've tried using an index or referencing the specific menuitem but no luck.
I am not populating the menuitems from a table.
Thanks for any help.
NavigationMenu.Items(8).NavigateUrl = Page.GetRouteUrl("New", ViewState("AccountId"))
NavigationMenu.FindItem("New").NavigateUrl = Page.GetRouteUrl("New", ViewState("AccountId"))
london24
Member
97 Points
108 Posts
Re: asp:menu and routing
Feb 20, 2012 07:35 PM|LINK
Hi
If the menu cannot be used with routing, can anyone suggest a good alternative please?
I am using asp.net v4.0 (VS 2010)
Thanks
london24
Member
97 Points
108 Posts
Re: asp:menu and routing
Feb 20, 2012 08:09 PM|LINK
Ok seems to be working now just using this in the code:
NavigationMenu.Items(0).NavigateUrl = Page.GetRouteUrl("Home", ViewState("AccountId"))
NavigationMenu.Items(1).NavigateUrl = Page.GetRouteUrl("MyProfile", ViewState("AccountId"))
etc