473,508 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pass variable to javascript

I have a javascript menu in my app, I need to hide certains menu options
based on the credentails of the user logging into the app. How can I hide
menu items on a javascript menu based on log in creditionals?

example:
if the user logged in is a Owner then he would see "wholesale" as a menu
option, if
its a customer then "wholesale" should not appear as a menu option
Mar 14 '06 #1
1 1126
Simply use conditional statements in your ASP.NET code to generate the
appropriate JavaScript. If there are a large number of differences between
the menus for different credentials, you could either separate the
JavaScript into a number of subroutines that you call with different
parameters or just have two .js files and in your page's header specify the
appropriate one as the src attribute of the script tag. What technique you
use is up to you, which one is best depends on what kind of techniques you
use in the menu code and what you are most comfortable using. Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"CSharpguy" <CS*******@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
I have a javascript menu in my app, I need to hide certains menu options
based on the credentails of the user logging into the app. How can I hide
menu items on a javascript menu based on log in creditionals?

example:
if the user logged in is a Owner then he would see "wholesale" as a menu
option, if
its a customer then "wholesale" should not appear as a menu option

Mar 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3117
by: Seeker | last post by:
Newbie question here... I have a form with some radio buttons. To verify that at least one of the buttons was chosen I use the following code ("f" is my form object) : var btnChosen; for...
7
3434
by: olga | last post by:
Hi, On my site, i want to pass a javascript variable to php. I know that this needs to done in a link or in a post. I want to know if there is a way i can do it with an html link. I should...
3
2390
by: brett | last post by:
I need to pass a hard coded value to a JS file: <script language="JavaScript" src="Tracking.js" type="text/javascript"></script> Neither of these methods work: <script language="JavaScript"...
2
6428
by: Augusto Cesar | last post by:
Hello people. How can I Pass ASP Array variable to Javascript; I´m to trying this: <script language="JavaScript"> var x = new Array(10);
3
1667
by: Boki | last post by:
Hi, Could you please advice, can javascript accept this kind of code? function resone(cnt) { alert("document.all.txt_note"+cnt) // cnt is the textbox index
2
4856
by: pleaseexplaintome | last post by:
Hi I have the following perl/cgi script snippet. The goal of this script is to pass a javascript variable to perl where it can be re-used later. Any help is appreciated, Thanks ...
10
16478
by: mike4722 | last post by:
I wish to have the form to be able to automatically select the radio button based on the logic of HTML/php variable. example show below: javascript: function autoForm(value) { var myForm =...
4
4328
by: IRC | last post by:
hey, i am pretty new on javascript as well as PHP, Hey, anyone can you help me, how to pass the javascript array value to php page......... i want to retrieve the values which are arrayed on...
2
7225
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I don't think this is possible, but here goes. I have a webform containing a javascript method. The javascript method is fired when the page loads and it populates some client-side input...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.