Forms Authentication redirect from login refreshes in VS,NET

Discussion in 'ASP .Net' started by Max, Jan 6, 2004.

  1. Max

    Max Guest

    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!
     
    Max, Jan 6, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alfredo Barrientos
    Replies:
    0
    Views:
    520
    Alfredo Barrientos
    Aug 31, 2005
  2. Dave
    Replies:
    4
    Views:
    1,358
  3. Max Figueredo via .NET 247

    Forms Authentication won't redirect to login page

    Max Figueredo via .NET 247, Sep 22, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    157
    Max Figueredo via .NET 247
    Sep 22, 2004
  4. Stephen Davies

    Forms Authentication - Sudden Redirect Failure on Login

    Stephen Davies, Jul 6, 2006, in forum: ASP .Net Security
    Replies:
    14
    Views:
    270
    Stephen Davies
    Jul 26, 2006
  5. lost hope
    Replies:
    4
    Views:
    198
    lost hope
    May 23, 2005
Loading...

Share This Page