我爱您的ASP.net元标记解决方案.规范链接标签将如何工作? [英] I love your solution for ASP.net meta tags. What will work for a Canonical Link tag?
本文介绍了我爱您的ASP.net元标记解决方案.规范链接标签将如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
希望这对您有帮助,
我想使用新的规范链接标记来确保搜索引擎各种各样的链接和子域都指向同一页面.每个网页都需要一个唯一的标签. HTML规范标签看起来像这样;
I hope this finds you well,
I want to use the new canonical link tag to assure search engines that a wide variety of links and subdomains are all pointing to the same page. Each Webpage needs a unique tag. The HTML canonical tag looks like this;
<link rel="canonical" href="http://example.com/" />
我尝试对BasePage.cs进行此操作;
I tried doing this to the BasePage.cs;
if (!String.IsNullOrEmpty(Link_Canonical))
{
HtmlMeta tag = new HtmlMeta();
tag.Name = "canonical";
tag.Content = Link_Canonical;
Header.Controls.Add(tag);
}
}
...并放在Home.aspx上;
...and put this on the Home.aspx;
Link_Canonical="canonical" href="http://example.com/home.aspx"
我做错什么了?如何重新编写代码以使用规范链接标记?
祝您一切顺利,
亲切的问候,
2PointOh
What did I do wrong? How can I re-write your code to work with the canonical link tag?
Wishing you the best with everything you do,
Kindest regards,
2PointOh
推荐答案
我没有ASP.NET元标记的解决方案.我假设某个Code Project用户这样做了,并写了一篇有关它的文章.在这种情况下,文章下方会有一个论坛可用来询问作者的问题.
I don''t have a solution for ASP.NET meta tags. I assume that some Code Project user does, and wrote an article about it. In which case, there''s a forum under the article to use to ask questions of the author.
这篇关于我爱您的ASP.net元标记解决方案.规范链接标签将如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文