|
-
Aug 23rd, 2005, 04:22 PM
#1
Thread Starter
Hyperactive Member
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
-
Aug 24th, 2005, 04:19 AM
#2
Frenzied Member
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!
-
Aug 24th, 2005, 08:37 AM
#3
Thread Starter
Hyperactive Member
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
-
Aug 24th, 2005, 08:47 AM
#4
Frenzied Member
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!
-
Aug 24th, 2005, 09:46 AM
#5
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|