天天看点

ASP.NET4.0 新功能之 SEO 增强 .

 ASP.NET4.0提供了一系列新的特性实现网站的 SEO优化,包括:

  • Page类的新属性:Page.MetaKeywords 和 Page.MetaDescription;
  • ASP.NET Web Forms 新的URL路由功能;
  • Response.RedirectPermanent()、Response.RedirectToRoutePermanent()方法等。

Page.MetaKeywords 和 Page.MetaDescription属性将生成  html 标记中的<meta name="description" content="" /> 和 <meta name="keywords" content="" />

C# 代码

<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

-->Page.MetaDescription = "南湖国旅:http://www.i-holiday.cn//";

Page.MetaKeywords = "盛武聪";

HTML 代码 < meta name ="description" content ="" />

< meta name ="keywords" content ="" />

详细信息可以参考:

http://msdn.microsoft.com/en-us/library/system.web.ui.page.metakeywords%28VS.100%29.aspx

http://msdn.microsoft.com/en-us/library/system.web.ui.page.metadescription%28VS.100%29.aspx

Response.RedirectPermanent()将进行HTTP 301(Moved Permanently)重定向。

继续阅读