Skip to main content
1 of 6
Falak Mahmood
  • 17.3k
  • 2
  • 41
  • 67

By default code blocks are not allowed on Master pages or Page layouts.

You have to 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