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
Hi. i'm using V4 and trying to use the .Net member controls to get at my member info.
I want to display my members name on a page and have come up with a control that does the following
protected void Page_Load(object sender, EventArgs e) { Member myMember = Member.GetCurrentMember(); string strName = "cannot find property"; try { myMember.getProperty("Name").ToString(); } catch { //hmmm. something wrong here. } lblUserName.Text = strName; }
I'm after the member name, NOT the login, but the name that appears in the umbraco admin when you're searching for a particular member.
I've googled and can't see how to access the "default" properties of a member, of which this is one.
Can anyone help?
I've missed out a "strName=" in that try statement, but still having the same problems. How does one edit a post on here?
Shaun,
A member's name can be retrieved as:
myMember.Text;
Hope this helps.
Regards,
/Dirk
Members should be interacted via the ASP.NET Membership API, not the Member API directly. There is a section on the wiki for this.
@Slace That's cool, but you can't display the MemberName using the Membership API, only the Username.
Thanks all. Dirks answer worked fine for me.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Having trouble getting the member name to display.
Hi. i'm using V4 and trying to use the .Net member controls to get at my member info.
I want to display my members name on a page and have come up with a control that does the following
I'm after the member name, NOT the login, but the name that appears in the umbraco admin when you're searching for a particular member.
I've googled and can't see how to access the "default" properties of a member, of which this is one.
Can anyone help?
I've missed out a "strName=" in that try statement, but still having the same problems. How does one edit a post on here?
Shaun,
A member's name can be retrieved as:
Hope this helps.
Regards,
/Dirk
Members should be interacted via the ASP.NET Membership API, not the Member API directly. There is a section on the wiki for this.
@Slace That's cool, but you can't display the MemberName using the Membership API, only the Username.
Thanks all. Dirks answer worked fine for me.
is working on a reply...