I'm using MasterPages to create the layout for all of the pages in my project. Before I converted the Default.aspx page over to the masterpage format this worked.
I have two pages, login.aspx and default.aspx, of course I'm using Forms Authentication. All that works fine, you try to get to default it prompts for login.
Well I used a custom function for the login, it compares data entered to that in a database, if it passed it also returns a variable containing there Trust Level. (String)
At the end of the Button Submit Click but before I redirect the authenticated user to the page they requested I use this code to store trust level in the Session object.
Session("Trust")=TRUST
When the default page loads it shows/hides elements base on thier trust. Now after I've switched over to master pages the code no longer works, it's returning an empty string for Session("Trust")
Example:
<% If Session("Trust") = "Admin" Then %>
Your Access Level is Administrator
<% Else %>
Your Access Level is <% Response.Write(Session("Trust")) %>
<% End If %
I'm loggin in with the Admin Account with a trust of "Admin" and it's just returning an empty string.
Any ideas?What are you using to redirect? If you are not currently, you should be using the RedirectFromLoginPage method.
HTH...
CHris
Thx for the reply,
I figured it out, it was because I deleted the Global.* file. D'OH
0 comments:
Post a Comment