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 ="孟宪会";
将生成如下代码:
<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(VS.100).aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.page.metadescription(VS.100).aspx
Response.RedirectPermanent()将进行HTTP 301(Moved Permanently)重定向。