Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Programmatically accessing registered users in DNN databaseProgrammatically accessing registered users in DNN database
Previous
 
Next
New Post
5/7/2010 1:45 PM
 
Hi--

My question is about how to programmatically access user accounts, e-mails, etc. from the DNN database. Doesn't seem to be working for me


Here are the details:

I'm developing some services which I'll put on a subdomain - but I'm selling subscriptions to online client-side software (with a front end in silverlight or AJAX) - and the data will be vended by WCF services. Different subscriptions (i.e., user roles) will have access to different amounts / types of data


So far, common problem.


However I've only worked with the basic ASP.NET 2.0 membership model that ships with the framework - DNN builds on top of this.

So I fired up a test web application and replaced the "LocalSqlServer" name with the connection string for the DNN database in the <connectionStrings/> section of the web.config file.

I also verified that "ailling" is a user name under the dbo.aspnet_Users table within my DNN database.

However the following line of code returns null:

MembershipUser usr = Membership.GetUser("ailling");


So my question is:
1) Should you be able to access users programmatically from the ASP.NET membership model that ships with the framework, or does DNN use a custom provider model that I need to connect to?

2) If you can use the base-ASP.NET membership model, am I just doing it the wrong way? Any special parameters, etc. need to be provided?


Everything I google on this always returns me information about how to build your own custom membership provider model, either within DNN or the framework--that's not what I want to do. I just want to tap into the users in my DNN database from code.




Thanks in advance!

Alan
 
New Post
5/7/2010 6:27 PM
 
To be honest I can't say I've ever tried to access things using the standard asp.net membership within DNN.

DNN has it's own API for getting at user, profile and security information. Primarily you are going to use UserController, RoleController and ProfileController I believe.

If you get an instance of those controllers you can then access things like UserController.GetUser and other functionality that you are going to need to access. GetUser would return a UserInfo object which you can use as well. I believe the namespaces are from DotNetNuke.Entities.Users off the top of my head.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Programmatically accessing registered users in DNN databaseProgrammatically accessing registered users in DNN database


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out