我可以在我的全新MVC4项目中使用ASP.net会员提供商吗? [英] Can I Use ASP.net membership provider in my brand new MVC4 project

查看:70
本文介绍了我可以在我的全新MVC4项目中使用ASP.net会员提供商吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在MVC4中开始一个新项目。我是否可以使用asp.net成员资格提供程序进行身份验证/授权。应用程序中的角色很少(最多5个角色)。但有优质和付费的客户。我们需要区分这些用户。请建议。



我可以使用它的一部分吗?仅限用户注册和授权?我想使用我自己的基于角色的系统。有可能吗?

谢谢,

Srinivas

解决方案

我认为可以随时使用。

但是MVC提供了像Authorize这样的属性来提供基于角色的授权。

考虑到身份验证,表格和窗口都可以肯定使用。

但是在MVC您可以创建自定义授权属性。请查看以下链接: -

ASP.NET MVC应用程序中的自定义表单身份验证 [ ^ ]



自定义属性访问参数 [ ^ ]

回复您的查询(如果有的话)。

希望这会有所帮助。

谢谢

Hi,

I am staring a new project in MVC4. Can I use asp.net membership provider for my authentication/authorization purpose. There are very few roles in application(max 5 roles). But there are premium and paid customers. we need to distinguish these users. Please suggest.

Can I use a part of it? Like only for user registration and authorization? I want to use my own role based system. Is it possible?
Thanks,
Srinivas

解决方案

I think that can always be used.
But MVC provides attributes like Authorize for providing authorization based on roles.
And considering Authentication both forms and windows can be used for sure.
But in MVC you can create Custom Authorize attributes. Check the links below:-
Custom Forms Authentication in ASP.NET MVC Application[^]

Custom attribute that access parameters[^]
Post back your queries if any.
Hope this helps.
Thanks


这篇关于我可以在我的全新MVC4项目中使用ASP.net会员提供商吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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