2012-06-20 46 views
0

我使用的是MVC3的网站,它没有出现在Google搜索中。作为SEO优化的一部分,我想把meta标签放在_layout.cshtml中。将meta标签仅放在母版页或内容页中是否好?什么是更好的SEO技术?元标记是静态的。提前致谢。asp.net中的meta标签mvc 3

回答

2
  1. Meta标签这是所有网站应该在其中介绍了一些自定义的页面_layout.cshtml
  2. Meta标签的地方应该在这个页面定义了你的自定义栏目。

例子:

_layout.chtml 
    <head> 
     <title>@Html.Raw(ViewBag.Title)</title> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    ... other common tags 
     @RenderSection("Meta", required: false) // your section 
    ... 
    </head> 

在自定义页面,你应该使用

@model SomeModel 
@section Meta 
{ 
    <meta name="description" content="your custom tag" /> 
// other custom tags 
} 
// some html or other code