开发者

How to validate if a user has logged in website in ASP.NET MVC2?

开发者 https://www.devze.com 2023-02-01 00:14 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消