ASP.NET Executing code in the header

Something like this will not work

<meta property="og:url" content="<%= Utilities.GetFacebookURL() %>" />

Replaced ‘<%=' with '<%#' [code language="html"] <meta property="og:url" content="<%# Utilities.GetFacebookURL() %>" /> [/code] and added in Master Page code behind [code language="csharp"] protected override void OnLoad(EventArgs e) { base.OnLoad(e); Page.Header.DataBind(); } [/code] Thanks to ASP.NET Resources

Leave a Reply

Your email address will not be published. Required fields are marked *