This topic is locked

Redirect after successful login

10/27/2006 22:31:33
ASPRunnerPro General questions
C
chris author

Sub AfterSuccessfulLogin()
'** Redirect to another page ****
if Session("USERNAME") = "Admin" then

Response.Redirect "DBUSER_List.asp"

else

Response.Redirect "COMPANY_INFORMATION_List.asp"

end if
End Sub
This doesn't seem to redirect me where I want to go. Basically it always goes to either one or the other if I change the condition from = to <> no matter what the username is.

I only want the Admin user to go to DBUser and everyone else go to Company_Information.

Chris.

Sergey Kornilov admin 10/31/2006

You need to use Session("UserID")

Sub AfterSuccessfulLogin()

'** Redirect to another page ****
if Session("UserID") = "Admin" then

Response.Redirect "DBUSER_List.asp"

else

Response.Redirect "COMPANY_INFORMATION_List.asp"

end if
End Sub