Facebook Open Graph Tag

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 年 前
Hi,

Im tring to implement the facebook meta tag for product page like:

<meta property="og:url" content="" />
<meta property="og:image" content="" />
<meta property="og:site_name" content="" />

on _Root.Head.cshtml i put this:

  @if (IsSectionDefined("AddToHead"))
    {
        @RenderSection("AddToHead", required: false).ToHtmlString();
    }  

on _ProductBox.cshtml i put this:
@section AddToHead{
    <meta property="og:title" content="@Model.Title" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="@Model.URL" />
    <meta property="og:image" content="@Model.FBImage" />
    <meta property="og:site_name" content="" />
}

but doesnt work. the meta tags doesn´t appear. Is there a way to resolve this?
Thanks
11 年 前
Does not work by design...

Se this post:
http://stackoverflow.com/questions/5525602/razor-nested-layouts-with-cascading-sections


Cheers
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.