Skip to main content
5 of 6
deleted 192 characters in body
Falak Mahmood
  • 17.3k
  • 2
  • 41
  • 67

Update: Is there an another way to get just the value out of the page content type field?

Yes, you can get the value out of page Content Type field:

in C#, it would be like

string valueoffield = (string)SPContext.Current.ListItem["YourContentTypeFieldName"];

Remember: By default code blocks are not allowed on Master pages or Page layouts, but can allow them in web.config using the following code:

 <pageparserpaths>      
    <pageparserpath virtualpath="/_catalogs/masterpage/*" compilationmode="Always"           allowserversidescript="true" includesubfolders="true".>
    </pageparserpaths>
Falak Mahmood
  • 17.3k
  • 2
  • 41
  • 67