Retrieving DisplayName programatically

Vote:
 

Given I have the CurrentPage object, is it possible to get the value of the DisplayName programatically?
So in example below i should get "test". (CurrentPage.PageTypeName returns name, not the dsiplayname)

[ConSubmittentType(DisplayName ="test"

[Pasting files is not allowed]

#114226
Dec 08, 2014 9:10
Vote:
 

Well I guess you are doing the right thing and keeping all your content type names in a lang file so you could get them with the Translate ;)

Else something like 

var repo = ServiceLocator.Current.GetInstance<ContentTypeRepository>());
            var pageType = repo.Load<currentpage.GetOriginalType()>();
            return pageType.DisplayName;
#114230
Dec 08, 2014 9:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.