M
Max
Hi,
I am using Visual Studio .NET 2003 to create a simple login page using
Forms Authentication. I don't have any problems when running the
program in the web browser, however when I try to run it through VS my
login page just refreshes.
I created two web forms 1) has username and password textboxes, 2) has
button to logout.
It doesn't matter what do I set to be my start page - behavior is the
same. If I choose logout to be my start page it goes to login with
ReturnUrl pointing to logout (where it should go after successfull
login but instead it just refreshes.
Here is my Web.Config:
<authentication mode="Forms">
<forms name=".SchoolFormsCookie" loginUrl="login.aspx"
protection="All" path="/">
<credentials passwordFormat="Clear" >
<user name="ad" password="ad" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" /> <!-- Deny anonymous users -->
<allow users="*" />
</authorization>
Here is the code for button on my login page:
If IsValid Then
If FormsAuthentication.Authenticate(txtUsername.Text,
txtPassword.Text) Then
FormsAuthentication.SetAuthCookie(txtUsername.Text, False)
Response.Redirect("logout.aspx")
Else
lblMessage.Text = "Bad username/password!"
End If
End If
Is there a problem with a way my Visual Studio or IIS is setup? Any
help would be appreciated!
I am using Visual Studio .NET 2003 to create a simple login page using
Forms Authentication. I don't have any problems when running the
program in the web browser, however when I try to run it through VS my
login page just refreshes.
I created two web forms 1) has username and password textboxes, 2) has
button to logout.
It doesn't matter what do I set to be my start page - behavior is the
same. If I choose logout to be my start page it goes to login with
ReturnUrl pointing to logout (where it should go after successfull
login but instead it just refreshes.
Here is my Web.Config:
<authentication mode="Forms">
<forms name=".SchoolFormsCookie" loginUrl="login.aspx"
protection="All" path="/">
<credentials passwordFormat="Clear" >
<user name="ad" password="ad" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" /> <!-- Deny anonymous users -->
<allow users="*" />
</authorization>
Here is the code for button on my login page:
If IsValid Then
If FormsAuthentication.Authenticate(txtUsername.Text,
txtPassword.Text) Then
FormsAuthentication.SetAuthCookie(txtUsername.Text, False)
Response.Redirect("logout.aspx")
Else
lblMessage.Text = "Bad username/password!"
End If
End If
Is there a problem with a way my Visual Studio or IIS is setup? Any
help would be appreciated!