Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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
 
<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
 
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";
           }
 
       }
Posted 6-Jan-13 18:22pm
ntitish1.4K
Edited 6-Jan-13 21:16pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes it is possible.
 
Is that only you want to know ?
  Permalink  
Comments
ntitish at 7-Jan-13 0:56am
   
sir, for menu item also there will be a click event ....as like button
ntitish at 7-Jan-13 0:58am
   
why because i want to display the three alert panels out of four according to the menu item. is there any way........
Sheikh Muhammad Haris at 7-Jan-13 1:03am
   
then post your code here and ask whatever you want properly :)
ntitish at 7-Jan-13 1:28am
   
//this is the code for menu controll
 
<asp:Menu ID="MenuLoginPage" runat="server" Orientation="Horizontal"
StaticMenuItemStyle-CssClass="menuUpper" StaticMenuItemStyle-BackColor="White"
BackColor="#CCCCCC" DynamicMenuItemStyle-BackColor="#CCCCCC"
onmenuitemclick="MenuLoginPage_MenuItemClick">
<asp:MenuItem Text="Home" NavigateUrl="~/WelcomePage.aspx">
<asp:MenuItem Text="About Us" NavigateUrl="~/aboutusdisplay.aspx">
<asp:MenuItem Text="Job Search" NavigateUrl="~/job_search.aspx">
<asp:MenuItem Text="Discussion Forum" NavigateUrl="~/carrerresources_display.aspx">
<asp:MenuItem Text="Career Resources" NavigateUrl="~/carrerresources_display.aspx">
<asp:MenuItem Text="Login" NavigateUrl="~/loginsection.aspx">
<asp:MenuItem Text="Contact Us" NavigateUrl="~/contact_us.aspx">

 
//by clicking on menu item "home" i want to display only three alert panels(JOB ALERTS,EVENTS,SITE ALERTS,NEWS ALERTS) out of four panels which are already on the LOGIN.MASTER PAGE how you are seeing on the current page of code project as like Your Filters,Top Experts In 24 Hours,Top Experts In one month.
ntitish at 7-Jan-13 3:35am
   
i updated my question now i think you will understand........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 645
1 OriginalGriff 560
2 CPallini 294
3 Peter Leow 185
4 RyanDev 146
0 OriginalGriff 6,034
1 Sergey Alexandrovich Kryukov 4,838
2 Peter Leow 3,129
3 Maciej Los 3,079
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100