自定义ASP.NET配置文件和成员资格 [英] Custom ASP.NET Profile and Membership Provider

查看:91
本文介绍了自定义ASP.NET配置文件和成员资格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立一个人们将加入的网站。他们将拥有自己的个人资料和其他相关的东西。我想以这样的方式为他们实现自定义成员资格和个人资料提供者,以便一个成员可以根据他/她输入的记录搜索和查看彼此的个人资料。

我已经跟随这个来实现自定义配置文件类。现在的问题是它有一个get和set块。在get和set块中,我计划通过自定义SQL查询设置和获取属性。但是我遇到的问题是如何才能获得当前登录的用户?(例如,在SQL查询的where子句中传递一个雇员id)。

我想通过以下方式实现它自定义提供程序,因为内置的ASP.NET配置文件提供程序不便于搜索属性(如果它可用我不知道)

如果有人可以帮我解决这个问题,我会很高兴。在此先感谢。

解决方案

为您的自定义会员提供商试用此网站dude;这还包括自定义角色提供者。



http://www.brianlegg.com/post/2011/05/09/Implementing-your-own-RoleProvider-and-MembershipProvider-in-MVC -3.aspx [ ^ ]


您是否看过这篇文章:

[这里]

I am trying to build a website where a group of people will join. They will have their own profile and other related things. I want to implement custom membership and profile providers to them in such a way that one member can search and view profile of each other based on the records entered by him/her.
I have followed this to implement custom profile class. Now the thing is that it has a get and set blocks. Inside the get and set block I planned to set and get the properties via my custom SQL query. However I am facing a problem which is how can I get the current logged in user?(to pass for example an employee id in the where clause of the SQL query).
I want to implement it via custom providers because the built in ASP.NET Provider for Profiles does not facilitate searching over the properties (if it is available I am unaware)
I would be glad if anybody could help me in solving this problem. Thanks in advance.

解决方案

Try this site dude for your custom membership provider; this also includes custom role provider.

http://www.brianlegg.com/post/2011/05/09/Implementing-your-own-RoleProvider-and-MembershipProvider-in-MVC-3.aspx[^]


Have you seen this article:
[here]


这篇关于自定义ASP.NET配置文件和成员资格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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