title: asp.net menu with submenu items, redirect by code behind
body: <p>I have a menu control with 2 levels of menu items!
  I would like to navigate via code behind OnMenuItemClick event because when i use NavigationUrl property my ajax UpdateProgress wont start!</p>
  
  <p>The Problem is, whatever submenu item i click, when the event raises it gets every time the first item?!</p>
  
  <pre><code>&lt;asp:Menu ID="Menu1" runat="server" onmenuitemclick="Menu1_MenuItemClick" &gt;
  ...
      &lt;Items&gt;
      &lt;asp:MenuItem Text="WorkFlows"&gt;
      &lt;asp:MenuItem Text="Overview" Value="Workflow"&gt;&lt;/asp:MenuItem&gt;
      &lt;asp:MenuItem Text="Edit" Value="Workflow"&gt;&lt;/asp:MenuItem&gt;
      &lt;asp:MenuItem Text="Create" Value="Workflow"&gt;&lt;/asp:MenuItem&gt;
      &lt;asp:MenuItem Text="Delete" Value="Workflow"&gt;&lt;/asp:MenuItem&gt;
      &lt;/asp:MenuItem&gt;
  
      &lt;asp:MenuItem Text="HoursOfBusiness"&gt;
      &lt;asp:MenuItem Text="Overview" Value="HoursOfBusiness"&gt;&lt;/asp:MenuItem&gt;
      &lt;asp:MenuItem Text="Edit" Value="HoursOfBusiness"&gt;&lt;/asp:MenuItem&gt;
      &lt;asp:MenuItem Text="Create" Value="HoursOfBusiness"&gt;&lt;/asp:MenuItem&gt;
      &lt;asp:MenuItem Text="Delete" Value="HoursOfBusiness"&gt;&lt;/asp:MenuItem&gt;
      &lt;/asp:MenuItem&gt;
  
  
      &lt;/Items&gt;
      &lt;/asp:Menu&gt;
  
  protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
          {
  
              switch (e.Item.Value)
              {
                  case "Workflow":
                      switch (e.Item.Text)
                      {
                          case "Overview":
                              Response.Redirect("~/RGS/Workflow/Workflow.aspx");
                              break;
                              case "Edit":
                              Response.Redirect("~/RGS/Workflow/WorkflowEdit.aspx");
                              break;
                              case "Create":
                              Response.Redirect("~/RGS/Workflow/WorkflowCreate.aspx");
                              break;
                              case "Delete":
                              Response.Redirect("~/RGS/Workflow/WorkflowDelete.aspx");
                              break;
                      }
                      break;
                  case "HoursOfBusiness":
                      switch (e.Item.Text)
                      {
                          case "Overview":
                              Response.Redirect("~/RGS/Workflow/BusinessHour/BusinessHours.aspx");
                              break;
                          case "Edit":
                              Response.Redirect("~/RGS/Workflow/BusinessHour/BusinessHours.aspx");
                              break;
                          case "Create":
                              Response.Redirect("~/RGS/Workflow/BusinessHour/BusinessHoursCreate.aspx");
                              break;
                          case "Delete":
                              Response.Redirect("~/RGS/Workflow/BusinessHour/BusinessHours.aspx");
                              break;
                      }
                      break;
              }
  </code></pre>
  
  <p>so when i click Create under HoursOfBusiness i get the Overview menuItem send to the event?!
  I hope the explanation is understandable?! :-)</p>