This is what I use:
Code:
<authentication mode="Forms">
<forms loginUrl = "Login.aspx"/>
</authentication>
<authorization>
<allow users="?" />
</authorization>
And then in my login page I have:
VB Code:
Imports System.Web.Security
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim objTicket As FormsAuthenticationTicket
Dim objCookie As HttpCookie
Dim strReturnURL As String
If ValidateLogin() Then
objTicket = New FormsAuthenticationTicket(txtUsername.Text, False, 30)
objCookie = New HttpCookie(".ASPXAUTH")
objCookie.Value = FormsAuthentication.Encrypt(objTicket)
Response.Cookies.Add (objCookie)
strReturnURL = Request.Params("ReturnURL")
If strReturnURL Is Nothing Then
Response.Redirect ("Main.aspx")
Else
Response.Redirect (strReturnURL)
End If
Else
lblMessage.Visible = True
lblMessage.Text = "Invalid username/password."
End If
End Sub
Does that help?
Woof