Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to enhance a CreateUserWizard in Umbraco. Add several custom fields (f. name, l. name, tel etc) and save them either in members table or in a separate custom table in SQL.
Could you please let me know if it is possible?
I managed to add custom fields in Member Types but it does not give me the right result. First and the foremost problem is that I can't see where in database Umbraco saves custom field values so I can retrieve it.
Check out this blog post: http://www.aaron-powell.com/umbraco-members-profiles
This is the method I always use to add custom fields to members and access them via a custom class. It works well for me. In the createuserwizard usercreated event I set any custom properties.
I think you could also access the properties with the Member API similar to the way you access a Document's properties (m.getProperty("firstName").Value), but I think that's obsolete.
Hope that helps,Tom
Another good resource is http://umbraco.miketaylor.eu/2010/08/29/authenticating-new-members/
This takes you through a step-by-step setup of a typical member site - with all the usual login and sign up features as well as custom profile fields.
It is all based on the ASP.Net Membership system so you can use the server controls if you wish.
Thank you for your interesting comments. I will check both links and let you know how it goes. Although, there is one thing I wanted to ask you. As I see from a quick look at both posts user information is retrieved using API. There is nothing said whether it is recorded in SQL database or not. The reason I am asking is, there will be a desktop application which will need to talk and share data with my web application through database. Users I register through my Umbraco based web application need to be shared with desktop application and show up on the other end. So as you understand sharing data through SQL DB is important.
I wanted to find out, is there a way to register and then retrieve user data from SQL DB which I am using for Umbraco? Something like, creating a new table and inserting additional user information there?
Membership data is stored in the SQL DB. You have 2 options
I have not seen an example of 2 anywhewre but it should not be a problem - Umbraco membership is fully compatible with standard ASP.Net membership, so it will just be a case in your web.config to define the MembershipProvider to point to your external DB. For instance, in your connections section you could have an entry like so:
<add name="MyMembershipConn" connectionString="server=.\SQLEXPRESS;database=MyMemberDB;trusted_connection=True" providerName="System.Data.SqlClient"/>
and then down in your membership section, your provider defined as
<add name="SqlServerMembershipProvider" connectionStringName="MyMembershipConn" requiresQuestionAndAnswer="false" applicationName="MyMemberApp" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Personally I would go for #1 if there is a tight corelation between the systems, and definitely if the desktop app needs to access other site data (like content, nodes etc). #2 should definitely be possible and would be interesting to know how you get on with it! It would be more suited to a system where the 2 apps are quite separate but simply need to store the same member system.
Thank you for explaining it. I thought going for option 2 in the beginning as I already have everything set up and working, just need to migrate into Umbraco. Project I did is on ASP.NET and I am trying to build it on Umbraco.
I am very interested how option 2 works too. I will try and let you know how it goes.
Thank you for your help.
Just wondering how you went with this. I am also working on a similar system and I have the basic member registration and login working from an external (ASP.Net membership) DB - but I have not got Profile to work as yet (adding extra profile fields like Name, Phone etc)
I was working on it yesterday. I am getting the following error message (error on line 44):
Line 43: DataSource.InsertParameters.Add("UserId", UserGUID.ToString());
Line 44: DataSource.Insert(); Line 45:
Line 46: //Insert Checkbox values
I am trying to find the reason but no luck yet. Meantime it is registering user in ASP.NET membership User table ok but does not register any extra field details into the DB. Must be because of above error.
Please let me know if error is familiar to you. I will continue working on it this afternoon and will keep you posted how it goes.
I managed to integrate ASP.NET membership service to Umbraco. Works fine. Let me know if you managed to do it or need help.
Can you please drop some snippets, I am trying to achieve the same thing but I am facing some difficulties with the whole approach.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted