Stanislav Godin

Stanislav Godin

  • NA
  • 8
  • 2.6k

Put Menu control Value property to Session variable web form

Jan 27 2015 12:09 PM
Hello, I need to track what itme was clicked on a navigation menu. I handle the events bases on that later. I wanted to put the Value propery of a menu item into a session variable:
   protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {


            Session.Add("MenuSelect", e.Item.Value.ToString());
            Label1.Text = "You came from " + (string)(Session["MenuSelect"]);


    }


I have four links in the menu. Three of them have the NaviateUrl proerty set to a page. One doesn't have the NavigateUrl. The Label I put to view the session shows the Value property only for that link (without the url). When the url is set, the session variable goesn't get set. Why that happens? Is there any other way to track what was clicked on the Menu control?


Thanks,
Stan