Hardselecting page to be selected in a MenuList

Vote:
 
Hi, I have been searching for an answer for this but have not really got anything to work. What do be done: A submenu (made through the use of a menulist in an ascx), where you can select which page to be selected disregarding of the page that is actually selected. (the pageid to actually be selected in the menu is available). I guess I somehow need to set(override?) the CurrentPage and return the page of the page to actually be displayed. But I have absolutely no idea of how to do this. Somehow I think I have to make this in the codebehind file? :) Any help appreciated (even if its only a hint of where to start looking). /Marcus
#12373
Sep 23, 2005 11:28
Vote:
 
I don't know if this works, but worth a try. MenuControl.CurrentPage.PageLink = new PageLink(100); MenuControl.DataBind(); Regards, Micke
#14147
Sep 23, 2005 17:06
Vote:
 
Hi Mikael, Thank you very much for your input, It steered me in the right direction, I didnt even think about setting the CurrentPage.PageLink before(I had only tried setting the MenuControl.PageLink property). I now managed to get it to work properly (how simple once you see it:) For other people that want to do this, this is how I did it: In the codebehind file I did this: Page_Load function: if(!IsPostBack) { MenuListControl.PageLink = YourMenuRootPageReference; MenuListControl.CurrentPage.PageLink = PageToBeSelectedReference, MenuListControl.DataBind(); } And I removed any bindings in the first :menulist in the ascx file (no pagelink there). -marcus
#14148
Sep 26, 2005 17:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.