Guys,
Thanks much for your suggestions so far:up:
What I found out was that I need to put the following into the web.config file as well..
<authorization>
<deny users="?"/>
</authorization>
After adding the above tags..the users are redirected to the login page.
Then I added this into the click event for the login button
If FormsAuthentication.Authenticate(txtUserName.Text,txtPassword.Text) Then
Dim myurl As String
myurl = FormsAuthentication.GetRedirectUrl(txtUserName.Text, False)
If Not (myurl = "/MySecurity/default.aspx") Then
'The method below takes you back to the page you wanted to go in the first place
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)
Else
lblMsg.Visible = True
lblMsg.Text = "You Are Authenticated"
EndIf
End If
But now I have something else on hand..
If I were to go to the login page first to get authenticated (without going to any other page). Then the following function bombs..
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)
so..I did a workaround by putting in a check...
myurl = FormsAuthentication.GetRedirectUrl(txtUserName.Text, False)
If Not (myurl = "/MySecurity/default.aspx") Then
....
....
....
But now after succesfully logging in I want to take my user to a welcome page which will have a kind of a site map.
How do I do this?Mind you response.redirect("welcome.aspx") does not work!:(