Results 1 to 5 of 5

Thread: webusercontrol + session variables

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397

    webusercontrol + session variables

    my webusercontrol has a series of buttons that direct user to other pages.

    what i'm trying to do is limit the number of buttons on the webusercontrol depending on a users security level. any ideas?


    ie.

    If Session("ULevel") = 2 Then

    'only show button.one and button.two

    end if

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: webusercontrol + session variables

    Hide all buttons by default.

    Have a switch statement (select statement in VB.NET) for each level of security which shows the buttons as required. The switch statement should be in the Page_Load method of the web control.

    Let me know if you need any other help.

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397

    Re: webusercontrol + session variables

    Thats just it, how do you show and hide items?

    i know if it was a normal item i could just write something like:
    me.item.visible = true

  4. #4
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: webusercontrol + session variables

    Server-side it's just .Visible = false

    e.g. For a Button called btnNew - btnNew.Visible = false

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397

    Re: webusercontrol + session variables

    it must have been a long day yesterday...

    on the page load event of the usercontrol is where i needed to set the buttons = visible, i was trying to do it on each page.


    thanks for the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width