Display name in Admin section after Welcome

May 30, 2011 at 11:08 PM

Hi friends,

I've this little problem in the Admin section, that I don't understand: I select a link in the "tabs toprounded" menu and the Welcome shows my DisplayName; when I select the "extensions" option, it shows my "First Name" proprety.

This is the code

<%= Resources.labels.welcome %>  <%= UserProfile() == null ? Page.User.Identity.Name : UserProfile().DisplayName %>
So, how can I fix?
Thanks a lot, bye! :)
Alessio
Coordinator
May 30, 2011 at 11:28 PM

Which version of BE are you using?  Some of the recent builds are using Razor for the Extensions pages in the control panel.  These Razor pages have their own master layout file, so it might work differently there.

If you're using BE 2.0, the same master page layout is used for the entire control panel.

May 31, 2011 at 8:05 PM

Hi Ben,

I'm using developer version of  BE 2.0.0.6

Coordinator
May 31, 2011 at 9:23 PM

Extensions page in your version probably uses razor (.cshtml) master page. So admin/_Layout.cshtml would need to incorporate same logic as above.

May 31, 2011 at 11:41 PM
Edited May 31, 2011 at 11:43 PM

Thanks Rtur,

I found it, as you say, in the _Layout.cshtml:

@Resources.labels.welcome @AuthorProfile.GetProfile(Security.CurrentUser.Identity.Name)

So, I don't know razor engine, and how can I convert it?

Coordinator
Jun 1, 2011 at 3:26 AM

This should work:

@Resources.labels.welcome&nbsp;@if (AuthorProfile.GetProfile(Security.CurrentUser.Identity.Name) == null)
{ @Page.User.Identity.Name }
else
{ @AuthorProfile.GetProfile(Security.CurrentUser.Identity.Name).DisplayName }

Jun 1, 2011 at 8:33 AM

Thanks, thanks, thanks, thanks a lot! :D