Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Forms Authentication redirect from login refreshes in VS,NET

Thread Tools

Forms Authentication redirect from login refreshes in VS,NET

Posts: n/a
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" />

<deny users="?" /> <!-- Deny anonymous users -->
<allow users="*" />

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)
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!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect To Login Page - Forms Authentication Dave ASP .Net 4 07-08-2009 09:56 PM
Forms Authentication - Sudden Redirect Failure on Login Stephen Davies ASP .Net Security 14 07-26-2006 04:35 AM
Login in HTTPS and redirect to HTTP using Forms Authentication Alfredo Barrientos ASP .Net 0 08-31-2005 09:31 PM
maintaining login status across page refreshes lost hope Javascript 4 05-23-2005 05:07 PM
Forms Authentication won't redirect to login page Max Figueredo via .NET 247 ASP .Net Security 0 09-22-2004 07:45 PM