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# 代码
Page.MetaDescription = " ASP.NET 4.0学习站点:http://dotnet.aspx.cc/ " ;
Page.MetaKeywords
= " 孟宪会 " ;


将生成如下的代码:

HTML 代码
< meta name ="description" content ="ASP.NET 4.0学习站点:http://dotnet.aspx.cc/" />
< 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)重定向。

你可能感兴趣的:(html,优化,C#,url,asp.net,Forms)