For ASPx Pages
<PageParserPaths> <PageParserPath VirtualPath="/pages/[file name].aspx" CompilationMode="Always" AllowServerSideScript="true" /> </PageParserPaths>
For master page, this will enable inline code blocks for all master pages:
<PageParserPaths> <PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" /> </PageParserPaths>
2.The other option is to user HTML controls in your page. But even in this scenario SharePoint will adds an Auto Generated ID suffix and the control id changes like the one give below.
So you may have to remove the auto generated suffix and keep only the label id.