First Q: where should i put the web.config file. Should I put it at the same folder as the login File or one level down.
Second Q:after i figured out that user can have access I use Response.Redirect(url) to direct him to a specific page, How the web.config will understand that the user Login successfully and allow him to use the resource
PLEASE HELP. Totally lostHi there,
I assume you want to use FormsAuthentication to authenticate users, then redirect them based on their login? If so, set your web.config file to force users to login before they do anything.. from there in your login logic you can redirect the user.
The web.config file can stay at the same level as the login.aspx page.
For more information on how to implement your login logic and FormsAuthentication lookhere and go to the Security-->FormsAuthentication section.
But if i am using
FormsAuthentication.RedirectFromLoginPage(UserEmail.Value, PersistCookie.Checked)
it will direct me to the default page. How can I redirect them to specific page?
If this is my script:
<script language="VB" runat=server>
Sub Login_Click(Src As Object, E As EventArgs)
' authenticate user: this samples accepts only one user with
' a name of someone@.www.contoso.com and a password of 'password'
If UserEmail.Value = "someone@.www.contoso.com" And UserPass.Value = "password"
FormsAuthentication.RedirectFromLoginPage(UserEmail.Value, PersistCookie.Checked)
Else
Msg.Text = "Invalid Credentials: Please try again"
End If
End Sub
</script
where shoud i put the redirect(specificPage.aspx) when the user first login
Have you tried this?
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=539073
0 comments:
Post a Comment