简体   繁体   中英

ASP.NET MVC and ASP.NET membership template provider

In a standard ASP.NET MVC template application that is created by default in Visual Studio when starting a new ASP.NET MVC application there is already a built-in membership / authentication / authorization system.

Using web search one can find lots of info about how to work with a built-in ASP.NET membership system, but very often this material is a bit of an old and refer to ASP.NET only, not mentioning ASP.NET MVC framework.

Just for example: http://msdn.microsoft.com/en-us/library/ms998347.aspx#paght000022%5Fmembershipapis or http://www.4guysfromrolla.com/articles/091207-1.aspx

To what extent all that applies to ASP.NET built-in membership system applies also to ASP.NET MVC ready template membership system?

MVC模板使用标准的ASP.NET成员资格服务。

As Franci points out, ASP.NET MVC uses the same provider models as ASP.NET for Membership, Roles and Profiles, but as it doesn't really use the Server Control model, you'll find that you need to write the controls yourself (or use the examples in the /Views/Account folder and the the AccountController).

In terms of tutorials for it, a good place to start would be the Learn MVC section of the ASP.NET site, especially:

Authenticating Users with Forms Authentication

Where you'll see that the examples for creating and administering users and roles are identical as those for ASP.NET.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM