How to validate if a user has logged in website in ASP.NET MVC2?
I have a table in database called Cus开发者_开发问答tomer, I want to enable them to log in website? Is there any good practice to suggest? Thanks!
Enable forms authentication in web.config.
Create a login page, and in login method, validate the user. Use FormsAuthentication class to set the authentication cookie.
Here is a write up for the forms authentication
If you create an asp.net mvc site project in visual studio, you will see an implementation of authentication.
精彩评论