header mail to name

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 years ago
Hello all,

How can i change the users mailaddress into the users name?
<%=Page.User.Identity.Name %> displays mailaddress

Thanks
15 years ago
Replace with  <%=NopContext.Current.User.FullName %>
15 years ago
Ok got it!

Thanks for your help!
15 years ago
how to show only surname?

Kind regards
15 years ago
<%=NopContext.Current.User.LastName %>
15 years ago
I tried that but I get:
CS1061: 'NopSolutions.NopCommerce.Common.CustomerManagement.Customer' does not contain a definition for 'LastName' and no extension method 'LastName' accepting a first argument of type 'NopSolutions.NopCommerce.Common.CustomerManagement.Customer' could be found (are you missing a using directive or an assembly reference?)

Thanks
15 years ago
Sorry. Look at Customer's FullName property. You should get the last name the same way as we do (using customer's attributes). Nop.Common\Customer\Customer.cs
15 years ago
You could just be cheeky and split the full name :p
15 years ago
Is this an option?
CustomerAttribute firstNameAttr = customerAttributes.FindAttribute("FirstName", customer.CustomerID);
            if (firstNameAttr != null)
                txtFirstName.Text = firstNameAttr.Value;
15 years ago
You're right. Just replace FirstName with LastName
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.