Search code examples
c#asp.netwebformsinline-code

Old ASP.NET webform has some inline code getting encoded :(


I've got a ASP.NET webforms site with some inline code on a master page ..

<meta property="og:title" content="<%=HeadTitle %>"/>

but it's rendering that line as..

<meta property="og:title" content="&lt;%=HeadTitle %>" />

In the codebehind, i have the following ...

protected string HeadTitle { get; set; }

Can anyone help?


Solution

  • Remove the runat="server" attribute from the <head> tag in the master page.