Hemal Joshi

Hemal Joshi

  • NA
  • 78
  • 48.5k

How to activate user clicked menu when template integration

Mar 15 2017 1:48 AM
Hello Guys,
I have to implement active menu when user click on that at that time it will active in master page with template integrated. 
 
Here i have provide my .aspx page so u can understand better.
 
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="AdminMasterPage.master.cs" Inherits="Admin_AdminMasterPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Indian Hunt Admin</title>
<!-- Bootstrap Styles-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FontAwesome Styles-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- Morris Chart Styles-->
<link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
<!-- Custom Styles-->
<link href="assets/css/custom-styles.css" rel="stylesheet" />
<!-- Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<form id="form1" runat="server">
<div id="wrapper">
<nav class="navbar navbar-default top-navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="AdminHome.aspx">Indian Hunt</a>
</div>
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<!-- <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
<i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>-->
<!--<ul class="dropdown-menu dropdown-messages">
<li>
<a href="#">
<div>
<strong>John Doe</strong>
<span class="pull-right text-muted">
<em>Today</em>
</span>
</div>
<div>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s...</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<strong>John Smith</strong>
<span class="pull-right text-muted">
<em>Yesterday</em>
</span>
</div>
<div>Lorem Ipsum has been the industry's standard dummy text ever since an kwilnw...</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<strong>John Smith</strong>
<span class="pull-right text-muted">
<em>Yesterday</em>
</span>
</div>
<div>Lorem Ipsum has been the industry's standard dummy text ever since the...</div>
</a>
</li>
<li class="divider"></li>
<li>
<a class="text-center" href="#">
<strong>Read All Messages</strong>
<i class="fa fa-angle-right"></i>
</a>
</li>
</ul>-->
<!-- /.dropdown-messages -->
</li>
<!-- /.dropdown -->
<li class="dropdown">
<!-- <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
<i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>-->
<!-- <ul class="dropdown-menu dropdown-tasks">
<li>
<a href="#">
<div>
<p>
<strong>Task 1</strong>
<span class="pull-right text-muted">60% Complete</span>
</p>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
<span class="sr-only">60% Complete (success)</span>
</div>
</div>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<p>
<strong>Task 2</strong>
<span class="pull-right text-muted">28% Complete</span>
</p>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="28" aria-valuemin="0" aria-valuemax="100" style="width: 28%">
<span class="sr-only">28% Complete</span>
</div>
</div>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<p>
<strong>Task 3</strong>
<span class="pull-right text-muted">60% Complete</span>
</p>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
<span class="sr-only">60% Complete (warning)</span>
</div>
</div>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<p>
<strong>Task 4</strong>
<span class="pull-right text-muted">85% Complete</span>
</p>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 85%">
<span class="sr-only">85% Complete (danger)</span>
</div>
</div>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a class="text-center" href="#">
<strong>See All Tasks</strong>
<i class="fa fa-angle-right"></i>
</a>
</li>
</ul> -->
<!-- /.dropdown-tasks -->
</li>
<!-- /.dropdown -->
<li class="dropdown">
<!-- <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
<i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-alerts">
<li>
<a href="#">
<div>
<i class="fa fa-comment fa-fw"></i> New Comment
<span class="pull-right text-muted small">4 min</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<i class="fa fa-twitter fa-fw"></i> 3 New Followers
<span class="pull-right text-muted small">12 min</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<i class="fa fa-envelope fa-fw"></i> Message Sent
<span class="pull-right text-muted small">4 min</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<i class="fa fa-tasks fa-fw"></i> New Task
<span class="pull-right text-muted small">4 min</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<i class="fa fa-upload fa-fw"></i> Server Rebooted
<span class="pull-right text-muted small">4 min</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a class="text-center" href="#">
<strong>See All Alerts</strong>
<i class="fa fa-angle-right"></i>
</a>
</li>
</ul> -->
<!-- /.dropdown-alerts -->
</li>
<!-- /.dropdown -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<!-- <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
</li>
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
</li>
<li class="divider"></li>-->
<li><a href="../Home.aspx"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
</nav>
<!--/. NAV TOP -->
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">
<li>
<a href="AdminHome.aspx" class="active-menu"><i class="fa fa-dashboard"></i>Dashboard</a>
</li>
<!-- Category -->
<li>
<a href="#"><i class="fa fa-desktop"></i>Category<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li id="AddCategory" runat="server">
<a href="Category.aspx">Add Category</a>
</li>
<li id="EditCategory" runat="server">
<a href="EditCategory.aspx">Edit Category</a>
</li>
<li>
<a href="DeleteCategory.aspx">Delete Category</a>
</li>
</ul>
</li>
<!-- Sub Category -->
<li>
<a href="#"><i class="fa fa-bar-chart-o"></i>Sub Category<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="SubCategory.aspx">Sub Category</a>
</li>
<li>
<a href="EditsubCategory.aspx">Edit Sub Category</a>
</li>
<li>
<a href="DeletesubCategory.aspx">Delete Sub Category</a>
</li>
</ul>
</li>
<!-- Subsub Category -->
<li>
<a href="#"><i class="fa fa-qrcode"></i>Sub Sub Category<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="SubsubCategory.aspx">Sub Sub Category</a>
</li>
<li>
<a href="EditSubsubCategory.aspx">Edit Sub Sub Category</a>
</li>
<li>
<a href="DeleteSubsubCategory.aspx">Delete Sub Sub Category</a>
</li>
</ul>
</li>
<!-- Job -->
<li>
<a href="#"><i class="fa fa-table"></i>Jobs<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="Job.aspx">Add Job</a>
</li>
<li>
<a href="EditJob.aspx">Edit Job</a>
</li>
<li>
<a href="DeleteJob.aspx">Delete Job</a>
</li>
</ul>
</li>
<!-- Company -->
<li>
<a href="#"><i class="fa fa-edit"></i>Company<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="AddCompany.aspx">Add Company</a>
</li>
<li>
<a href="EditCompany.aspx">Edit Company</a>
</li>
<li>
<a href="DeleteCompany.aspx">Delete Company</a>
</li>
</ul>
</li>
<!-- OLD Data -->
<!-- IMPNumber Information -->
<li>
<a href="#"><i class="fa fa-sitemap"></i>IMP Numbers<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="IMPNumber.aspx">IMPNumber</a>
</li>
<li>
<a href="EditIMPNumber.aspx">Edit IMPNumber</a>
</li>
<li>
<a href="DeleteIMPNumber.aspx">Delete IMPNumber</a>
<!--<a href="#">Second Level Link<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="#">Third Level Link</a>
</li>
<li>
<a href="#">Third Level Link</a>
</li>
<li>
<a href="#">Third Level Link</a>
</li>
</ul>-->
</li>
</ul>
</li>
<!-- News -->
<li>
<a href="#"><i class="fa fa-table"></i>News<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="News.aspx">Add News</a>
</li>
<li>
<a href="EditNews.aspx">Edit News</a>
</li>
<li>
<a href="DeleteNews.aspx">Delete News</a>
</li>
</ul>
</li>
<!-- School Information -->
<li>
<a href="#"><i class="fa fa-edit"></i>School<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="School.aspx">Add School</a>
</li>
<li>
<a href="EditSchool.aspx">Edit School</a>
</li>
<li>
<a href="DeleteSchool.aspx">Delete School</a>
</li>
</ul>
</li>
<!-- Business Tycoon -->
<li>
<a href="#"><i class="fa fa-sitemap"></i>Business Tycoon<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="BusinessTycoon.aspx">Add Business Tycoon</a>
</li>
<li>
<a href="EditBusinessTycoon.aspx">Edit Business Tycoon</a>
</li>
<li>
<a href="DeleteBusinessTycoon.aspx">Delete Business Tycoon</a>
</li>
</ul>
</li>
<!-- Website -->
<li>
<a href="#"><i class="fa fa-desktop"></i>Website<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="Website.aspx">Add Website</a>
</li>
<li>
<a href="EditWebsite.aspx">Edit Website</a>
</li>
<li>
<a href="DeleteWebsite.aspx">Delete Website</a>
</li>
</ul>
</li>
<!-- Post Job -->
<li>
<a href="#"><i class="fa fa-table"></i>Post Job<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="PostJob.aspx">Add Post Job</a>
</li>
<li>
<a href="EditPostJob.aspx">Edit Post Job</a>
</li>
<li>
<a href="DeletePostJob.aspx">Delete Post Job</a>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<!-- /. NAV SIDE -->
<div id="page-wrapper">
<div id="page-inner">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<!-- /. WRAPPER -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
<!-- Morris Chart Js -->
<script src="assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="assets/js/morris/morris.js"></script>
<!-- Custom Js -->
<script src="assets/js/custom-scripts.js"></script>
<!-- Menu -->
</form>
</body>
</html>
 
In above code by default Dashboard menu will be activated now when user click on the menu at that time it will be active.
 
So, Guys Reply fast........ 
 

Answers (1)