简体   繁体   English

在ASP.net MVC 4中自定义创建用户

[英]Custom Create User in ASP.net MVC 4

I have made an asp.net MVC 4 Internet application. 我已经做了一个asp.net MVC 4 Internet应用程序。 I wanted to have custom Create User function. 我想拥有自定义的“创建用户”功能。 So I used CreateUser function of MembershipProvider class and added <providers> configuration in my web.config . 因此,我使用了MembershipProvider类的CreateUser函数,并在web.config添加了<providers>配置。

But The problem is when I run the code it catches the exception Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion' . 但是问题是当我运行代码时,它捕获了异常找不到存储过程'dbo.aspnet_CheckSchemaVersion' Despite the database is generated by asp.net itself, it deosn't have any stored procedure (as previous versions had). 尽管数据库是由asp.net本身生成的,但它没有任何存储过程(如以前的版本一样)。

I can't use MVC 4's WebSecurity.CreateUserAndAccount function because it says it is not initialized. 我不能使用MVC 4的WebSecurity.CreateUserAndAccount函数,因为它表示未初始化。

So I don't know what to do. 所以我不知道该怎么办。 Any Help would be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

First of all, please use new ASP.NET Universal Providers . 首先,请使用新的ASP.NET通用提供程序

I wanted to have custom Create User function

  • If you want to take care of user authentication and authentication by yourself, you need to implement Custom Membership Provider which basically overrides Default Membership Provider. 如果您想自己进行用户身份验证和身份验证,则需要实现“ 自定义成员资格提供程序” ,它基本上会覆盖“默认成员资格提供程序”。

exception Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

  • you will not see that exception in new ASP.NET Universal Providers, because it doesn't use SchemaVersions table anymore. 您将不会在新的ASP.NET Universal Providers中看到该异常,因为它不再使用SchemaVersions表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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