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
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
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
Re: webusercontrol + session variables
Server-side it's just .Visible = false
e.g. For a Button called btnNew - btnNew.Visible = false
DJ
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!