Selected Menu Item Display in Label Using Asp.Net C#

Selected Menu Item Display in Label 

If  Select List Of  Menu Item Display the Label After Selected Items Only Using Asp.Net

                Download Coding  
                        Html Coding

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
   <asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick">
                <asp:MenuItem Text="India" Value="India"></asp:MenuItem>
                <asp:MenuItem Text="Australia" Value="Australia"></asp:MenuItem>
                <asp:MenuItem Text="Africa" Value="Africa"></asp:MenuItem>
            <asp:Label ID="lblMenu" runat="server" ForeColor="#CC3300"></asp:Label>

                  C# Coding

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Menusss : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
        lblMenu.Text = e.Item.Value;

First - Create - New - Web Form - Add the Menu From ToolBox

Select - Edit Menu Item -  Select Root Node - Add Items 

Next -  Edit Menu Item -  Select Root Node - Add Items 

Next -  Edit Menu Item -  Select Root Node - Add Items 

Next - Add One Label - change Id Name

Next - Menu Button Double Click 

Add - the Below Coding

Next - Run [F5] the Program


Post a Comment