2

In the standard default new website in VS2012, the Account section Login.aspx has a button to send the login information. There is no event code for that, it apparently runs "Login" which is the CommandName. Where is the code that processes that? Can it be added to or altered? I cannot find it it anywhere in the project. How does the Login actually happen?

0

1 Answer 1

1

The login button is within a <asp:Login /> web control. The <asp:Login /> control will use the default MembershipProvider set in web.config (or machine.config)...or you can set the MembershipProvider property on the Login control

How to: Use the ASP.NET Membership Provider

Membership and Role Provider

To control/alter the login logic you can create a custom MembershipProvider that override's the ValidateUser method.

Sign up to request clarification or add additional context in comments.

2 Comments

more informative than most, thank you. so the validate user method is what actually runs when that button is clicked? so i can create a method that adds logic to that process ?
ValidateUser is called when the login control's button w/CommandName="Login" is clicked, yes. To control the ValidateUser logic (not add, but replace) create a custom MembershipProvider class (like this sample one) and you can control the whole process. Also once you've created the custom MembershipProvider you'll update the web.config to include it as the default provider (all of that is outlined in the "How to" link in the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.