title: how to add menuItemClick event when menuItem is created programatically in asp.net?
body: <p>In my asp.net web application, i have created a menu and menuItem programatically based on the Logged in user role.The Code is given below...</p>
  
  <pre><code>    Menu menu = new Menu();
      menu.CssClass = "menu";
      menu.IncludeStyleBlock = false;
      menu.EnableViewState = false;
      menu.Orientation = Orientation.Horizontal;
  
      if (roleType.equals("teacher"))
      {
          MenuItem categoryItemCh1 = new MenuItem("Home");
          categoryItemCh1.NavigateUrl = "Teacher/TestsList.aspx";
          menu.Items.Add(categoryItemCh1);
  
          MenuItem categoryItemCh2 = new MenuItem("Account");
          categoryItemCh2.NavigateUrl = "Account/underconstruction.aspx";
          menu.Items.Add(categoryItemCh2);
  
          MenuItem categoryItemCh3 = new MenuItem("Reports");
          categoryItemCh3.NavigateUrl = "Account/underconstruction.aspx";
          menu.Items.Add(categoryItemCh3);
  
          MenuItem categoryItemCh4 = new MenuItem("Logout");
          menu.Items.Add(categoryItemCh4);
      }
  </code></pre>
  
  <p>So, When user clicks the logout menu item , then i have to fire menuItem click event to do the following process.<br></p>
  
  <p>1.Clear all the session associated with the user<br>
    2.Redirect to Login page.<br></p>
  
  <p>But i don't know how to add a menuItem click event programatically in asp.net.Please guide me to get out of this issue...</p>