.NET MVC 3(C#)的默认成员资格提供程序 - 如何设置? [英] .NET MVC 3 (C#) default membership provider - how to set up?

查看:116
本文介绍了.NET MVC 3(C#)的默认成员资格提供程序 - 如何设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有些由会员提供商.NET混淆。我建立了一个MVC 3 web应用程序,但显然登录,因为我需要线了成员资格提供网页不工作外的开箱。我本来期望这个过程很容易,但是当我搜索帮助我找到编写自定义提供了许多文章。我不能只是建立一个表或两个,电线了在web.config中的一些细节,并已工作的事情根据一些默认的MVC成员资格提供?

I'm somewhat confused by membership providers for .NET. I have built a MVC 3 web application, but obviously login pages don't work out-of-the-box because I need to wire up a membership provider. I would have expected this process to be easy, but when I search for help I find numerous articles on writing custom providers. Can't I just set up a table or two, wire up a few details in web.config and have things work based on some default MVC membership provider?

我不想重新发明轮子!

TIA。

推荐答案

的MSDN会员安装文档仍然适用通过对.NET 4中,但需要注意的是默认的成员资格提供程序的变化4.5 - 完全不同的表结构

The MSDN membership installation documentation is still applicable through to .NET 4, although note that the default Membership provider changes in 4.5 - totally different table structures.

TL; DR


  • 创建ASPNET会员数据库的的表添加到现有的数据库( aspnet_regsql.exe的,这是在.NET 2框架文件夹)

  • Create the aspnet membership database OR add the tables to your existing database (aspnet_regsql.exe, which is in the .net 2 framework folder)

必要的成员身份和角色提供配置部分添加到您的web.config。

Add the necessary membership and role provider configuration sections to your web.config.

使用网站管理员工具来添加用户(或至少一个初始管理员用户)

Use the site admin tool to add users (or at least an initial Admin User)

这篇关于.NET MVC 3(C#)的默认成员资格提供程序 - 如何设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆