I have a asp.net membership login control which logs registered users, this works. It uses Email + Password for login. Not sure why it's using email, should be using Username, anyway, can fix this later.
Now once the user logs in, I want to get the logged in Members full form details, I have this code in my template:
I would like to get registration's full data output, I.e. Username, Firstname, Lastname etc. Is this possible?
ANother question, I have another form which captures comments, how can I assign the logged in username to these comments, currently the comments have no memberId assigned to them? The way I was going to do it was get the logged in username then save this value to the comments form as an additional field.
I hope this all makes sense.I have strugged with this for over a week with no success. As you can tell I am new to Umbraco and Contour so any advice will be grately appreciated.
Regarding the comments, I seem to recall that Contour saves the MemberID of a logged in member automatically when submitting the form. Looking at the developer docs, I think it's saved as "memberkey".
You can also use member values as defaults for inputs, so for instance you could have a hidden field for login name, and assign a default value {member.loginname} to have it populated automatically.
Contour Registration can't get Username
Hi,
I have created a registration form using Contour, the fields are:
- Firstname
- Lastname
- Username
- Password
- Email
This form captures registrations no problem.
I have a asp.net membership login control which logs registered users, this works. It uses Email + Password for login. Not sure why it's using email, should be using Username, anyway, can fix this later.
Now once the user logs in, I want to get the logged in Members full form details, I have this code in my template:
@{
@umbraco.cms.businesslogic.member.Member.GetCurrentMember();
}
This outputs:
{ Id: 1122, Text: TestLastname, ParentId: -1 }
I would like to get registration's full data output, I.e. Username, Firstname, Lastname etc. Is this possible?
ANother question,
I have another form which captures comments, how can I assign the logged in username to these comments, currently the comments have no memberId assigned to them? The way I was going to do it was get the logged in username then save this value to the comments form as an additional field.
I hope this all makes sense.I have strugged with this for over a week with no success. As you can tell I am new to Umbraco and Contour so any advice will be grately appreciated.
Thanks.
I thought this would be a fairly easy one to solve for you masters!
Any experts out there willing to help this poor feeble humble developer?
Hi,
To get the properties of a member, you can use something like:
There's also a different way of accessing properties if you want to write a custom profile class: www.aaron-powell.com/umbraco-members-profiles
Regarding the comments, I seem to recall that Contour saves the MemberID of a logged in member automatically when submitting the form. Looking at the developer docs, I think it's saved as "memberkey".
You can also use member values as defaults for inputs, so for instance you could have a hidden field for login name, and assign a default value {member.loginname} to have it populated automatically.
Hope this helps,
Tom
Hi, thanks for the reply. I had already tried:
var member = umbraco.cms.businesslogic.member.Member.GetCurrentMember();
var prop = member.GetProperty("firstName").Value;
When I try this I get the following error:
Error loading MacroEngine script (file: )
I don't think GetCurrentMember has access to the 'firstname' property. It can only get:
{ Id: 1122, Text: TestLastname, ParentId: -1 }
Anything else I can try?
is working on a reply...