This is an offshoot of this question.
- How do I use a
Logincontrol if I don’t have aMembershipProviderto point it at? - Am I understanding the use model correctly?
- Is it even reasonable to talk about using a
Logincontrol without aMembershipProvider? - Dose the
MembershipProviderdo more than just username/password checking? - Would it be more reasonable to create my own
MembershipProviderwith the same authentication logic?
In my case, I don’t need a MembershipProvider (I think) as my authentication situation is trivial (one user, one password).
I’m interested partly to “future proof” my page and partly because I’m new and wondering about how stuff works. (I tend to learn about things by running full speed into every corner case I can find 🙂
You can just drop the asp:Login control in your page, then in the code behind, catch the Login Control’s Authenticate event.
In the Authenticate event, check the username/password that the user has entered. The username/password are properties in the login control. (LoginCtrl.UserName, LoginCtrl.Password)
If the username/password is correct, just set the event args Authenticated property to True.
No membership provider is required.
ex. In the aspx page..
In Code Behind
c#