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 7875995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:05:43+00:00 2026-06-03T03:05:43+00:00

I created a new project using aspx visual studio 2010. All I am trying

  • 0

I created a new project using aspx visual studio 2010. All I am trying to do is user logs in and I redirect to another page. I am going to save some stuff either as cookies or application/session objects.
So I created a brand new aspx application with the login templates. I opened login.aspx and I opened the code behind of the login button. When the user clicks ok, I connect to my sql server database and I validate their login/password. Once I do this and determine this is a valid user, How do I tell aspx that this is a valid user?

I noticed this:

        <div class="loginDisplay">
            <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                <AnonymousTemplate>
                    [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                </AnonymousTemplate>
                <LoggedInTemplate>
                    Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                    [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                </LoggedInTemplate>
            </asp:LoginView>

So I am assuming that I need to somehow say user is authenticated. But how? I guess I am a little confued on LoginTemplates VS Anonymous templates. How do I say Now use LoginTemplate vs anonymous. Is there a property or method that I have to execte?
Thanks

  • 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-06-03T03:05:43+00:00Added an answer on June 3, 2026 at 3:05 am

    Try this in Login1_Authenticate:

    You need to validate the user based on his details he entered.If the user passes the authentication redirect him to wherever you want.If not show him some message.

    Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
            Dim IsValidate As Boolean = Membership.ValidateUser(Login1.UserName, Login1.Password)
            If Not IsValidate Then
                e.Authenticated = False
                Login1.FailureText = "Please check your mail if not activated."
            Else
                e.Authenticated = True
            End If
    End Sub
    

    And in Login1_LoggedIn

    Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
            If Request.QueryString("Url") IsNot Nothing Then
                Response.Redirect("~/" & Request.QueryString("Url").ToString())
            Else
                Response.Redirect("~/Default.aspx")
            End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just created a new project using the visual studio cordova starter template. However
I have just created a new project in VS2010 using the Visual c# >
i'm using eclipse platform and window builder pro within. I've already created new project
I've been trying to create a new project using the files provided at ActionBarSherlock
I've created a new vs.net project and added all the files from an asp.net
I created new web project using VS 2008 with enabled Ajax template with C#
OK, here is how to re-create the problem had: Create a new project, using
I am using Railside to create a new Rails project. I am on a
I am using VS2010 to create a new unit test project to test my
I created a new project with the following code segment: char* strange = (Strange??);

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.