How to get Page type name from the current block View (CSHTML file) if the block is placed in the content area of a page

Vote:
 

How to get Page type name  from the current block  View (CSHTML file),  if the block is placed in the content area of a page

#151796
Aug 06, 2016 15:50
Vote:
 

You can use PageRouteHelper

var pageRouteHelper = ServiceLocator.Current.GetInstance<PageRouteHelper>();

var pageTypeName = pageRouteHelper.Page.PageTypeName;
#151819
Aug 08, 2016 9:22
* 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.