For this method you probably want to replace var currentUser with
var currentUser = Member.GetCurrentMember();
with your original code you're getting the .NET Member object which won't have the methods you're trying to access - you want the Umbraco Member object
@{ var currentUser = Member.GetCurrentMember();
if (currentUser!=null) { var userName = currentUser.Text; <p><strong> @userName</strong> </p> <p>@currentUser.getProperty("fullName").Value.ToString();</p> <p>Name: @currentUser.Email;</p> } }
Yep, BTW save yourself some duplication and performance by storing the current member in a variable and accessing that for the properties you need (Name, email, etc) instead of calling Member.GetCurrentMember() several times :)
Display Member Name
Hi,
Can someone point out how to i get to display another field from the members area.
Like for example if i have a field like First Name, Details or Company Name...
I have the following code working but only displaying Login and UserName and Email
//fuji
Here is how you can do it in C#: http://our.umbraco.org/forum/developers/extending-umbraco/27626-Accessing-Member-Information?p=0. So you could also do this with a helper or function in Razor.
Jeroen
I tried this to get the Current Node Name which is actually the First Name of Member
@userNames
Hi Jeroen,
I tried something like to
but getting an error on saving .
Using the member api can be slow, but if you really want to use that this might work:
Jeroen
Getting an error CS1061 while saving the cshtml
//fuji
For this method you probably want to replace var currentUser with
with your original code you're getting the .NET Member object which won't have the methods you're trying to access - you want the Umbraco Member object
-Tom
HI Jeroen,
This works for me instead
//fuji
Hi Tom,
Thanks for the reply, i guess i foound it as same. Same Same but in a different way of proceeding. But thanks to both of you for the help.
//fuji
Yep, BTW save yourself some duplication and performance by storing the current member in a variable and accessing that for the properties you need (Name, email, etc) instead of calling Member.GetCurrentMember() several times :)
Totally agree....
Hi, I was just wondering how you get the member types?
Standard users should only be able to see some information and admins other informations. That is what i want to achive.
Thanks :-)
Hi Daniel,
You could use this to get the alias of the current member's type:
This probably isn't cached, though FYI
-Tom
is working on a reply...