Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. MenuItem selected value

MenuItem selected value

Scheduled Pinned Locked Moved ASP.NET
designsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kmuthuk
    wrote on last edited by
    #1

    Hi <asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal"> <Items> <asp:MenuItem Text="Main Menu" Value="Test"> <asp:MenuItem Text="Second" Value="secondform.aspx"></asp:MenuItem> <asp:MenuItem Text="Third" Value="thirdform.aspx"></asp:MenuItem> </asp:MenuItem> </Items> </asp:Menu> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> and my Menu1_MenuItemClick event is: protected void Menu1_MenuItemClick(object sender, MenuEventArgs e) { Server.Transfer(((System.Web.UI.WebControls.Menu)(sender)).SelectedValue); } When I click the menu item, URL show the previous SelectedValue. Not the page is currently shown. Any help would be appreciated. Thanks Muthu

    C 1 Reply Last reply
    0
    • K kmuthuk

      Hi <asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal"> <Items> <asp:MenuItem Text="Main Menu" Value="Test"> <asp:MenuItem Text="Second" Value="secondform.aspx"></asp:MenuItem> <asp:MenuItem Text="Third" Value="thirdform.aspx"></asp:MenuItem> </asp:MenuItem> </Items> </asp:Menu> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> and my Menu1_MenuItemClick event is: protected void Menu1_MenuItemClick(object sender, MenuEventArgs e) { Server.Transfer(((System.Web.UI.WebControls.Menu)(sender)).SelectedValue); } When I click the menu item, URL show the previous SelectedValue. Not the page is currently shown. Any help would be appreciated. Thanks Muthu

      C Offline
      C Offline
      Chatura Dilan
      wrote on last edited by
      #2

      Hi kmuthuk, you need to set the navigateUrl property for each menu items, then it will work :)

      Chatura Dilan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups