Click here to Skip to main content
14,836,679 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello Friends

I m creating a web Application and menu are created using javascript in my application.

And now I want to disable some menus in my application.
I mean to say when different users enters thier different login and password, some menus are disabled according to my rights.

Pls Help me out as soon as possible. And Thanks in advance.
Posted
Comments
pankajupadhyay29 1-Mar-11 23:27pm
   
could you provide details how are you creating menus using <ul> <li>
or anything else? are you giving some id to menu element or not??
Sunil.yadava09 2-Mar-11 0:45am
   
Here is my code

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<link href="style.css" rel="Stylesheet" type="text/css" />
<link href="Accordian.css" rel="Stylesheet" type="text/css" />
<link href="Calendar.css" rel="Stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">

function DoBlur(fld)
{
fld.className='normalfld';
}

function DoFocus(fld)
{
fld.className = 'focusfld';
}
</script>

</head>
<body>
<form id="form1" runat="server" >
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<table style="width:960px; height:100%; margin-left:auto; margin-right:auto; background-color:White;" >
<tr>
<td style="text-align: left" >
<table style="width:950px" >
<tr>
<td valign="top">

</td>
<td style="text-align: right">
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/numax.JPG"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td >
<table style="width:950px">
<tr>
<td >
<ul id="nav">
<li><a href="#" >File</a>
<ul>
<li>
<asp:HyperLink ID="HyperLink14" runat="server">Online Query</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink60" runat="server" >Online Performance</asp:HyperLink>
</li>

<li>
<asp:HyperLink ID="HyperLink61" runat="server">Import DBF Data</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink62" runat="server">DateTime Setting</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink63" runat="server">Path Setting</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink64" runat="server">Change Password</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink65" runat="server">Log Off</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink66" runat="server">Exit</asp:HyperLink>
</li>
</ul>
</li>
</ul></td>
<td >
<ul id="nav">
<li><a href="#">Masters</a>
<ul>
<li>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Master/Company_Form.aspx">Company</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Master/Unit_Form.aspx">Unit</asp:HyperLink>
</li>
<li>
pankajupadhyay29 2-Mar-11 0:48am
   
as i can see you are using asp:HyperLink for menu items you can access these on code behind and disable these at page_load.
   
Add Javascript tag to your Question, and ASP.NET, is applicable.
--SA

1 solution

See here[^].
   

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




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