Saturday, March 24, 2012

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 optionSimply 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
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"CSharpguy" <CSharpguy@.discussions.microsoft.com> wrote in message
news:E01CDA5A-90E8-4BC3-9D12-0B9E377E4DE6@.microsoft.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

0 comments:

Post a Comment