newbie please help
|
| Posted: 03/14/2002, 4:21 PM |
|
ASP no Templates trying to display the logged in users name session variable at the top of each page in the header. Also need to show buttons based on the security level in the header. Any help would be appreciated.
|
|
|
 |
Sam M
|
| Posted: 03/14/2002, 5:03 PM |
|
First the headers:
Create a form
have the form look up the username in the users field from the db. In your form properties, place an input with the primary key for the users field and set the properties of that input to session. Call that session UserID
Easy.
Next part requires getting your hands dirty a bit.
Go into your code and find the buttons you want to hilight.
Before the button add something like this
<%if session("userrights") = "1" then%> BUTTON GOES HERE <%end if%>
Or
Say you have a button you want everyone over level two to see
That would look like this
<%if session("userrights") >2 then%>BUTTON GOES HERE<%end if%>
You can do this forever.
Don't forget to end your if statements in ASP
Forgetting to do that will generate an error.
|
|
|
 |
header
|
| Posted: 03/14/2002, 7:36 PM |
|
Sam thanks for the info. I have another question though. How do you display the userid in the header. for example: hello {userid} how do you get it to display the variable value. I created a page that is nothing but a header under header section I added a banner and want to display the logged in users name but I can't get it to display it? Once again any help would be appreciatted.
|
|
|
 |