2 Replies - 984 Views - Last Post: 11 October 2012 - 03:03 AM Rate Topic: -----

#1 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

how to select menu item/sub item through c# cofe

Posted 04 October 2012 - 07:52 AM

I am developing c# web application .net frame work 4.5.

I have created a menu control through following code.

<<asp:Menu ID="DropDownMenu" runat="server" OnMenuItemClick="DropDownMenu_MenuItemClick" Orientation="Horizontal">
<DynamicHoverStyle BackColor="Green" />
<Items>
<asp:MenuItem Text="Home" Value="Item1">
<asp:MenuItem Text="Sub Item1" Value="Sub Item1"></asp:MenuItem>
<asp:MenuItem Text="Functions" Value="Item5">
<asp:MenuItem Text="Reverse Complement" Value="Sub Item1"></asp:MenuItem>
<asp:MenuItem Text="Translation" Value="Sub Item2"></asp:MenuItem>
<asp:MenuItem Text="Reverse Translation" Value="Sub Item3"></asp:MenuItem>
<asp:MenuItem Text="Orf finder" Value="Sub Item4"></asp:MenuItem>
<asp:MenuItem Text="In Silico PCR" Value="Sub Item5"></asp:MenuItem>
</asp:MenuItem>




</pre>



The problem is that i dont know how to select a specific menu item or sub item.
e.g if i select menu sub item"translation", it should go on a new page.

would any one guide me please that how to select menue items and sub items through c# code ????

thanks

This post has been edited by Sabra khan: 04 October 2012 - 07:55 AM


Is This A Good Question/Topic? 0
  • +

Replies To: how to select menu item/sub item through c# cofe

#2 zeeshanef  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 76
  • Joined: 14-April 12

Re: how to select menu item/sub item through c# cofe

Posted 11 October 2012 - 01:34 AM

There is a propert in MenuItem [navigateurl];
<asp:MenuItem Text="Translation" Value="Sub Item2" navigateurl="Translation.aspx"></asp:MenuItem>


Check this page:
http://msdn.microsof...avigateurl.aspx

This post has been edited by zeeshanef: 11 October 2012 - 01:35 AM

Was This Post Helpful? 0
  • +
  • -

#3 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: how to select menu item/sub item through c# cofe

Posted 11 October 2012 - 03:03 AM

You could try response.redirect() to take you to a new page. :)

regards,
Raghav
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1