ASP.NET MVC 和 ASP.NET 成员资格模板提供程序
在启动新的 ASP.NET MVC 应用程序时默认在 Visual Studio 中创建的标准 ASP.NET MVC 模板应用程序中,已经有一个内置的成员资格/身份验证/授权系统。
使用 Web 搜索可以找到大量有关如何使用内置 ASP.NET 会员系统的信息,但这些材料通常有点过时,并且仅涉及 ASP.NET,而没有提及 ASP.NET MVC 框架。
仅举个例子: http://msdn.microsoft.com/en-us/库/ms998347.aspx#paght000022%5Fmembershipapis 或 https://web .archive.org/web/20210304121422/https://www.4guysfromrolla.com/articles/091207-1.aspx
在多大程度上适用于 ASP.NET 内置会员系统的所有内容也适用ASP.NET MVC 准备好模板会员系统了吗?
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 https://web.archive.org/web/20210304121422/https://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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Franci 指出的那样,ASP.NET MVC 使用与 ASP.NET 相同的提供程序模型来实现成员资格、角色和配置文件,但由于它并未真正使用服务器控件模型,因此您会发现需要自己编写控件(或使用 /Views/Account 文件夹和 AccountController 中的示例)。
就教程而言,一个好的起点是 学习 MVC 部分ASP.NET 站点,尤其是:
您将在其中看到创建和管理用户和角色的示例与 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:
Where you'll see that the examples for creating and administering users and roles are identical as those for ASP.NET.
MVC 模板使用标准 ASP.NET 成员资格服务。
The MVC template uses the standard ASP.NET membership service.