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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:55:53+00:00 2026-06-03T09:55:53+00:00

I have a Login control login1. When an user login his username and password,

  • 0

I have a Login control login1. When an user login his username and password, I want to display error message if something wrong.
By this link, we can easily fire an event by Login1_LoginError. However for some reason, our code always use Login1_Authenticate.
Sample code:

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) 
{ 
        bool UserAuthenticated = false; 
        MembershipProvider AuthenticationProviderUsed = null; 
        RoleProvider roleProvider = Roles.Providers["SqlRoleProvider"]; 
        MembershipUser user = Membership.GetUser(login1.UserName); 
        if (user != null && user.IsLockedOut) 
        { 
         \\ display error message
        }

My question is can I use the code inside the Login1_Authenticate enent? Because it used to be inside Login1_LoginError event.

Thanks.

Login1.FailureText = "Your account has been locked out blah blah....."; 
  • 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-03T09:55:54+00:00Added an answer on June 3, 2026 at 9:55 am

    The Login.Authenticate Event will be fired off every time there is an attempt to authenticate; it is where you can provide custom authentication. In this event, you should perform authentication and set e.Authenticated to true or false. Likely, if you set it to false, you’ll get to your Login1_LoginError handler. However, you can handle the failure to authenticate properly in the Login1_Authenticate handler without issue – you do not have to use Login1_LoginError.

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

Sidebar

Related Questions

I have a asp.net webpage that contain a custom login control like this: <div
Normally we have login page with username, password filed and signin button. Using the
I'm using the standard asp:Login control, and we have a user who recently changed
I have a fairly simple user control that represents a basic login control. So
I have an asp.net login control and I have implemented the user name to
i have a login control and a create user control i my web page...i
i have login control and textbox inside , i need to write UserName in
I'm using the asp.net login control for user authentication. I also have the userID
I want to create login user control in asp.net mvc site , to be
I have created a user control that has an asp:login control in it. I

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.