Hiding buttons depending on User Security Level.

Results 1 to 2 of 2

Thread: Hiding buttons depending on User Security Level.

  1. #1
    Marnie Guest

    Default Hiding buttons depending on User Security Level.

    Being relatively new to ASP I&#039;m having a small problem. <BR>Here it is.<BR>If a user has full access to certain portions of the site they can see everything...but if the user only has &#039;viewing&#039; access then I would like the edit/update/delete buttons to be greyed out and non clickable instead of black (these buttons are image buttons that I have created).<BR>I set up a function but it was clumsy and called on the database too often checking the security level of the user.<BR>Does anyone out there have a relatively easy function idea that won&#039;t bog down the database?

  2. #2
    Medieval Dude Guest

    Default RE: Hiding buttons depending on User Security Leve

    Check the database once, and save their security level in a variable. I prefer doing this on the default or home page and setting it in a session variable. Then, on yer page with the buttons, just have code like this (notice I&#039;m assuming my variable contains text, although you could use numeric or whatever you have your application set up as):<BR><BR>&#060;input type="button" &#060;%If Session("SecurityLevel") &#060;&#062; "Superman" Then%&#062; disabled &#060;%End If%&#062; ...&#062;

Posting Permissions

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