Facebook点赞按钮+点赞的页面请求登录 [英] Facebook Like button +The page being liked request login
问题描述
嗨!
使用Facebook的赞"按钮对我来说是个大问题.我有一个产品页面,其中有一个喜欢按钮,要访问该页面,您需要登录.
我用这种方法填充元数据:
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);
}
当我运行Facebook调试器时,出现此错误:
推断属性:即使可以从其他标签推断值,也应明确提供og:url属性.
推断属性:即使可以从其他标签推断值,也应明确提供og:title属性.
推断的属性:即使可以从其他标签推断一个值,也应明确提供og:description属性.
推断的属性:即使可以从其他标签推断值,也应明确提供og:image属性.
1.当我在网站上查看页面源代码时,meta标签是正确的..我是否必须以其他方式添加meta标签?我该怎么办?
2.我也收到错误消息(302),因为我有一个重定向路径(您必须先登录才能看到该页面).解决方案是什么?
我会很高兴获得answear,我花了4个小时进行搜索和尝试.
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!
推荐答案
,请点击以下链接.
StackOverflow [
Please follow the below link.
StackOverflow[^]
这篇关于Facebook点赞按钮+点赞的页面请求登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!