Click here to Skip to main content
15,895,462 members

facing problem in menu control of click event

ntitish asked:

Open original thread
i want to know whether there will be a click event of menu control. because in my website i used menu control for displaying menus and i am displaying four alert panels below the menu control. here i want to display only three panels according to the click event of menu item will it possible.

//here this is the code

XML
<Items><asp:MenuItem Text="Home"></asp:MenuItem></Items>
       <Items><asp:MenuItem Text="About Us"></asp:MenuItem></Items>
       <Items><asp:MenuItem Text="Job Search"></asp:MenuItem></Items>
       <Items><asp:MenuItem Text="Discussion Forum"></asp:MenuItem></Items>
       <Items><asp:MenuItem Text="Career Resources"></asp:MenuItem></Items>
       <Items><asp:MenuItem Text="Login"></asp:MenuItem></Items>
       <Items><asp:MenuItem Text="Contact Us"></asp:MenuItem></Items>



//cs code

C#
protected void MenuLoginPage_MenuItemClick(object sender, MenuEventArgs e)
       {
           if (e.Item.Text == "Home")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[0].NavigateUrl = "WelcomePage.aspx";
           }
           if (e.Item.Text == "About Us")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[1].NavigateUrl = "aboutusdisplay.aspx";
           }
           if (e.Item.Text == "Job Search")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[2].NavigateUrl = "job_search.aspx";
           }
           if (e.Item.Text == "Discussion Forum")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[3].NavigateUrl = "carrerresources_display.aspx";
           }
           if (e.Item.Text == "Career Resources")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[4].NavigateUrl = "carrerresources_display.aspx";
           }
           if (e.Item.Text == "Login")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[5].NavigateUrl = "loginsection.aspx";
           }
           if (e.Item.Text == "Contact Us")
           {
               panelTestimonials.Visible = false;
               MenuLoginPage.Items[6].NavigateUrl = "contact_us.aspx";
           }

       }
Tags: ASP.NET

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900