如何使用ASP在现有数据库中设置成员资格提供程序。净MVC吗?

时间:2022-09-18 07:32:18

For some reason, the idea of setting up Membership in ASP.NET MVC seems really confusing.

由于某些原因,在ASP中建立成员关系的想法。NET MVC看起来很混乱。

Can anyone provide some clear steps to setup the requisite tables, controllers, classes, etc needed to have a working Membership provider?

谁能提供一些明确的步骤来设置必要的表、控制器、类等,以获得一个有效的成员资格提供者?

I know that the Demo that MVC ships with has an Accounts controller. However, should I be using this in my own project? What do I need to get my existing database ready if so? If not, how do I learn what I need to do to implement a membership provider?

我知道MVC附带的演示程序有一个帐户控制器。但是,我应该在我自己的项目中使用它吗?如果需要的话,我需要什么来准备我的现有数据库?如果没有,我如何学习如何实现一个成员提供程序?

3 个解决方案

#1


19  

Check out this step by step blog on how to set up Membership provider in your asp.net mvc project. The sdk tool you need to get your database ready is aspnet_regsql.exe, you don't need to create a separate database to do that ( a lot of people think they have to provide a separate aspnet.db), you can run the command on your existing database, and it will create the tables, views, and stored procedures to handle the membership provider for you.

在asp.net mvc项目中如何设置成员资格提供程序,请一步一步地查看这个博客。准备数据库所需的sdk工具是aspnet_regsql。exe,您不需要创建一个单独的数据库(很多人认为他们必须提供一个单独的aspnet.db),你可以在现有数据库上运行的命令,它将创建表、视图和存储过程来为您处理会员提供者。

However, should I be using this in my own project? What do I need to get my existing database ready if so? If not, how do I learn what I need to do to implement a membership provider?

但是,我应该在我自己的项目中使用它吗?如果需要的话,我需要什么来准备我的现有数据库?如果没有,我如何学习如何实现一个成员提供程序?

The benefit to use the default provider (SqlMembership provider) is to save yourself a lot of time. It involves a lot of work to design a complete membership and role provider.

使用默认提供程序(SqlMembership提供程序)的好处是可以节省很多时间。设计一个完整的成员关系和角色提供者需要做很多工作。

Edit [2014-06-19] Asp.Net Identity Framework is Microsoft new recommendation to manage user sand permissions.

编辑[2014-06-19]Asp。Net Identity框架是Microsoft用于管理用户和权限的新推荐。

#2


2  

Check out this link: https://github.com/TroyGoode/MembershipStarterKit

看看这个链接:https://github.com/TroyGoode/MembershipStarterKit

Most of the work is already done for you. Just download the sample project and run the aspnet_regsql.exe against your database.

大部分工作已经为你完成了。只需下载示例项目并运行aspnet_regsql。exe反对您的数据库。

#3


1  

check out my answer in this post;

看看我在这篇文章里的答案;

membership

会员

If you want to keep the membership provider that .Net creates for you then you can copy all the tables etc to another sql database and point the provider at it via the config file.

如果您希望保留. net为您创建的成员资格提供程序,那么您可以将所有表复制到另一个sql数据库,并通过配置文件将提供程序指向它。

Post a comment if you need more than this.

如果你需要更多的评论,请发表。

#1


19  

Check out this step by step blog on how to set up Membership provider in your asp.net mvc project. The sdk tool you need to get your database ready is aspnet_regsql.exe, you don't need to create a separate database to do that ( a lot of people think they have to provide a separate aspnet.db), you can run the command on your existing database, and it will create the tables, views, and stored procedures to handle the membership provider for you.

在asp.net mvc项目中如何设置成员资格提供程序,请一步一步地查看这个博客。准备数据库所需的sdk工具是aspnet_regsql。exe,您不需要创建一个单独的数据库(很多人认为他们必须提供一个单独的aspnet.db),你可以在现有数据库上运行的命令,它将创建表、视图和存储过程来为您处理会员提供者。

However, should I be using this in my own project? What do I need to get my existing database ready if so? If not, how do I learn what I need to do to implement a membership provider?

但是,我应该在我自己的项目中使用它吗?如果需要的话,我需要什么来准备我的现有数据库?如果没有,我如何学习如何实现一个成员提供程序?

The benefit to use the default provider (SqlMembership provider) is to save yourself a lot of time. It involves a lot of work to design a complete membership and role provider.

使用默认提供程序(SqlMembership提供程序)的好处是可以节省很多时间。设计一个完整的成员关系和角色提供者需要做很多工作。

Edit [2014-06-19] Asp.Net Identity Framework is Microsoft new recommendation to manage user sand permissions.

编辑[2014-06-19]Asp。Net Identity框架是Microsoft用于管理用户和权限的新推荐。

#2


2  

Check out this link: https://github.com/TroyGoode/MembershipStarterKit

看看这个链接:https://github.com/TroyGoode/MembershipStarterKit

Most of the work is already done for you. Just download the sample project and run the aspnet_regsql.exe against your database.

大部分工作已经为你完成了。只需下载示例项目并运行aspnet_regsql。exe反对您的数据库。

#3


1  

check out my answer in this post;

看看我在这篇文章里的答案;

membership

会员

If you want to keep the membership provider that .Net creates for you then you can copy all the tables etc to another sql database and point the provider at it via the config file.

如果您希望保留. net为您创建的成员资格提供程序,那么您可以将所有表复制到另一个sql数据库,并通过配置文件将提供程序指向它。

Post a comment if you need more than this.

如果你需要更多的评论,请发表。