Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6680863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:31:29+00:00 2026-05-26T04:31:29+00:00

I have a menu control with 2 levels of menu items! I would like

  • 0

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!

The Problem is, whatever submenu item i click, when the event raises it gets every time the first item?!

<asp:Menu ID="Menu1" runat="server" onmenuitemclick="Menu1_MenuItemClick" >
...
    <Items>
    <asp:MenuItem Text="WorkFlows">
    <asp:MenuItem Text="Overview" Value="Workflow"></asp:MenuItem>
    <asp:MenuItem Text="Edit" Value="Workflow"></asp:MenuItem>
    <asp:MenuItem Text="Create" Value="Workflow"></asp:MenuItem>
    <asp:MenuItem Text="Delete" Value="Workflow"></asp:MenuItem>
    </asp:MenuItem>

    <asp:MenuItem Text="HoursOfBusiness">
    <asp:MenuItem Text="Overview" Value="HoursOfBusiness"></asp:MenuItem>
    <asp:MenuItem Text="Edit" Value="HoursOfBusiness"></asp:MenuItem>
    <asp:MenuItem Text="Create" Value="HoursOfBusiness"></asp:MenuItem>
    <asp:MenuItem Text="Delete" Value="HoursOfBusiness"></asp:MenuItem>
    </asp:MenuItem>


    </Items>
    </asp:Menu>

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;
            }

so when i click Create under HoursOfBusiness i get the Overview menuItem send to the event?!
I hope the explanation is understandable?! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:31:29+00:00Added an answer on May 26, 2026 at 4:31 am

    This is how I solved this problem:

    <asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick">
        <Items>
            <asp:MenuItem Text="WorkFlows">
                <asp:MenuItem Text="Overview" />
                <asp:MenuItem Text="Edit" />
                <asp:MenuItem Text="Create" />
                <asp:MenuItem Text="Delete" />
            </asp:MenuItem>
            <asp:MenuItem Text="HoursOfBusiness">
                <asp:MenuItem Text="Overview" />
                <asp:MenuItem Text="Edit" />
                <asp:MenuItem Text="Create" />
                <asp:MenuItem Text="Delete" />
            </asp:MenuItem>
        </Items>
    </asp:Menu>
    

    And the code behind is like this:

    protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
        bool hasParent = (e.Item.Parent != null);
    
        switch (hasParent)
        {
            case false:
                switch (e.Item.Value)
                {
                    case "WorkFlows":
                        Response.Redirect("~/RGS/Workflow/Workflow.aspx");
                        break;
                    case "HoursOfBusiness":
                        Response.Redirect("~/RGS/Workflow/BusinessHour/BusinessHours.aspx");
                        break;
                }
                break;
            case true:
                switch (e.Item.Parent.Value)
                {
                    case "WorkFlows":
                        switch (e.Item.Value)
                        {
                            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.Value)
                        {
                            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;
                }
                break;
    
        }
    }
    

    Hopefully this will help you solve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my asp.net website I have menu control and there are those items: <asp:menuitem
I have an asp:Menu control that has four different menu items in it. Each
I have a menu user control with image buttons like this one: <asp:TableCell ID=tcDownload
I have a control that has a label on it, that I would like
I have a ASP.Net Menu Control with three levels and flyouts enabled. I want
I have a site that uses a menu control tied to a sitemapdatasource which
Ok I have an asp.net menu control which is created from codebehind. It works
I have a multiview control on my page and a menu to create a
I have a web part which uses many SharePoint controls like menu, SPGrid, tool
I have menu bar and code is as follows <div style=background:#000; height: 25px;> <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.