Forms Authentication redirect from login refreshes in VS,NET

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top