header mail to name

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

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

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

Thanks for your help!
15 Jahre weitere
how to show only surname?

Kind regards
15 Jahre weitere
<%=NopContext.Current.User.LastName %>
15 Jahre weitere
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 Jahre weitere
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 Jahre weitere
You could just be cheeky and split the full name :p
15 Jahre weitere
Is this an option?
CustomerAttribute firstNameAttr = customerAttributes.FindAttribute("FirstName", customer.CustomerID);
            if (firstNameAttr != null)
                txtFirstName.Text = firstNameAttr.Value;
15 Jahre weitere
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.