Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi!

I have a big problem for me with the like button for Facebook. I have a products page where i have a like button and to reach this page you need to be logged in.

I fill the meta data with this method:

private void LoadMetaTagsForFacebook()
{
    HtmlMeta meta = new HtmlMeta();
    meta.Attributes.Add("property", "fb:app_id");
    meta.Attributes.Add("content", "");
    Page.Header.Controls.Add(meta);

    meta = new HtmlMeta();
    meta.Attributes.Add("property", "og:url");
    meta.Attributes.Add("content", Request.Url.ToString());
    Page.Header.Controls.Add(meta);

    meta = new HtmlMeta();
    meta.Attributes.Add("property", "og:site_name");
    meta.Attributes.Add("content", "Site.com");
    Page.Header.Controls.Add(meta);

    meta = new HtmlMeta();
    meta.Attributes.Add("property", "og:title");
    meta.Attributes.Add("content", this._product.Name);
    Page.Header.Controls.Add(meta);

    meta = new HtmlMeta();
    meta.Attributes.Add("property", "og:image");
    meta.Attributes.Add("content", this._product.ImagePath);
    Page.Header.Controls.Add(meta);

    meta = new HtmlMeta();
    meta.Attributes.Add("property", "og:type");
    meta.Attributes.Add("content", "drink");
    Page.Header.Controls.Add(meta);
}

When i run the facebook debugger i get this error:

Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property: The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property: The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.

1. When i look at the page source on the site the meta tags is right.. do i have to add the meta tags in a other way? How do i do that?

2. I also get a error (302) because i have a redirect path (you have to be logged in to see the page). What´s the solution for this?

I would be very happy for an answear, i have spent 4 hours searching and trying.

Thanks alot!
Posted
Updated 21-Jun-12 23:01pm
v2

1 solution

Please follow the below link.
StackOverflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900