pass variable to javascript

Discussion in 'ASP .Net' started by =?Utf-8?B?Q1NoYXJwZ3V5?=, Mar 14, 2006.

  1. 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
     
    =?Utf-8?B?Q1NoYXJwZ3V5?=, Mar 14, 2006
    #1
    1. Advertising

  2. 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

    http://www.nathansokalski.com/

    "CSharpguy" <> wrote in message
    news:...
    >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
     
    Nathan Sokalski, Mar 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QXVndXN0byBDZXNhcg==?=

    Pass ASP Array variable to Javascript

    =?Utf-8?B?QXVndXN0byBDZXNhcg==?=, Nov 6, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    15,511
    Mike Moore [MSFT]
    Nov 6, 2003
  2. Ben Kial
    Replies:
    1
    Views:
    723
    Eric Enright
    Nov 15, 2004
  3. Tricky
    Replies:
    0
    Views:
    607
    Tricky
    Mar 19, 2009
  4. Tricky
    Replies:
    0
    Views:
    1,058
    Tricky
    Mar 19, 2009
  5. Reuven
    Replies:
    0
    Views:
    614
    Reuven
    Mar 19, 2009
Loading...

Share This Page