Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 893999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:18:39+00:00 2026-05-15T14:18:39+00:00

I am developing an user authentication site. I have a login page, Login.aspx in

  • 0

I am developing an user authentication site.
I have a login page, “Login.aspx” in which i have provided a login control.
In the web.config,

<authentication mode="Forms">
        <forms name=".AuthenticationCookie" loginUrl="Login.aspx"  protection="All" timeout="60" path="/">
            <credentials passwordFormat="Clear">
                <user name="Jack" password="Jerry"/>
            </credentials>
        </forms>
    </authentication>
    <authorization>
        <deny users="*"/>
    </authorization>

In the login.aspx.cs page,
I have provided,

 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        if (FormsAuthentication.Authenticate(Login1.UserName,Login1.Password))
        {
             FormsAuthentication.SetAuthCookie(Login1.UserName,true);
            Label1.Text = "Login Successful";
            Login1.InstructionText = "";
            FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);
            Response.Redirect("Success.aspx")

        }
        else
        {
            Label1.Text = "You are not an authentic user";
        }


    }
}

but however, while execution instead of going to success.aspx
with the url http://localhost/Login.aspx?ReturnUrl=%2fSuccess.aspx

Why is this so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:18:40+00:00Added an answer on May 15, 2026 at 2:18 pm

    If you want to set the forms auth cookie yourself and redirect correctly based on the ReturnUrl query string parameter, you should look at the FormsAuthentication.RedirectFromLoginPage method. In your example, it would be:

    FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);
    

    That method sets the appropriate Forms auth cookie / ticket and then redirects based on the presence or absence of the ReturnUrl parameter. (If absent, it goes to the configured default page.)

    Hope this helps,

    Donnie

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an ASP.NET application which needs Windows Authentication. I have the web.config set
I was developing app which uses Facebook API authentication for user login. But sometimes
I'm developing a login and authentication system for a new PHP site and have
Im developing asp.net c# web site where i want to make user authentication. without
I am developing a Windows Forms application in C#. I have created user authentication
Am developing one website for which I have to do user login and registration
I'm developing an API system which requires this type of authentication. The user will
I'm developing a user preferences page and I've decided to use AngularJS to control
I am developing a user manager which must control access to the detail view
I am developing a user control (ascx) in ASP.NET which uses javascript for manipulating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.