开发者

How to get ALL user names from aspnet_users?

I am using the System.Web.ApplicationServices.AuthenticationService for Form Based Authentication.

The authenication is done by .LoginAsync based on the user roles got by .GetRolesForCurrentUserAsync.

开发者_JAVA技巧How to query the database to get a list of all users in the system? I need the list to populate a combobox so the users can pick a contact within the system to connect to instead of simply typing the names and hoping for no typos.

Is there a way to do that?

Thanks a lot.


You'll need to expose this information through your web service. Just make custom methods on your service that returns the data you need.

The Membership Provider is a common way to implement the interface to your database. See: http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.aspx. This certainly works good, though I find the provider often complicates things so just implement my own interface using the few methods I care about. Then just access the database however you are already doing (NHibernate, EF, LLBLGen, ADO.Net, etc).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜