About user's profiles...

Topics: Developer Forum
Oct 20, 2008 at 5:01 PM
I haven't found info about user profiles, and this is my question:
How could I extnd users profile? Do I need to edit N2.Security sourcecode and then compile to bin?
Please give me some info!
Thank you in advance.
Oct 20, 2008 at 6:13 PM
There is an implementation of the ASP.NET profile provider. I'm not sure if that cuts it for you. It's also possible to directly save any value on the items backing the users without really changing N2.Security.dll. Can you describe your scenario?
Oct 20, 2008 at 6:54 PM
Edited Oct 20, 2008 at 6:58 PM
Well, for example, I want to add password confirmation field, captcha field with captcha checking mechanism and some additional user fields like website, external ID number and so on...
And i want end-user to enter this data within registration process.
How can I do this?
Oct 20, 2008 at 8:08 PM
This is one of the areas where N2 neither helps nor stops you from picking your own path. The included implementation is very basic.

If you want to go down the profile provider path you could read up on profile providers: http://msdn.microsoft.com/en-us/library/aa479035.aspx
Can't say if this is a good alternative since I havn't really used them. There is a crude profile provider in n2.security.dll. I'd like to hear about successes in this area.

If you prefer working against N2 API's I suggest you look at the code in N2.Security. Especially the interactions against N2.Context.Current.Resolve<N2.Security.ItemBridge>(). Hope this helps.
Oct 21, 2008 at 4:08 PM
At first:
How could I override classes packed to dll files with no changes to your source code?
Maybe I'll need to create my own lib's?
And the second question is how I can move n2 to use SQLServer with ASP.NET membership users(it's own tables and stored procedures)?
Big thnx!
Oct 21, 2008 at 5:10 PM
1st:  The users are stored as content items, which in a way are just a bunch of data, e.g.
    item["MyData"] = "Some stuff I want to store";

2nd: Remove membership, roleManager and profile configuration from web.config. Then you probably need to create the database and tables. I think there is a tool in visual studio to do that.

Apr 6, 2010 at 12:27 PM

Does anyone have an example of how to simply add fields to the registration piece?  For example, in addition to "Username", "Password", and "Email", I have about 3 or 4 other pieces of data that I would like to collect.  I'm having a hard time translating the conversation above into a working example.


Apr 6, 2010 at 3:40 PM

Well if you end up wanting to use ASP.NET membership, role providers etc. anyway, then why don't you just implement your own logon/registration forms? That way you can actually link and store your extra data in any way you like when creating the user, either storing the data within a profile if you wanna go the "standard way", or in N2's tables, or in your own tables...