MVC和Meta标签搜索引擎优化 [英] MVC and Meta Tags for Search Engine Optimization

查看:118
本文介绍了MVC和Meta标签搜索引擎优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作MVC2。我想使用的元标记。我对元标记和搜索引擎优化新的。我的网页上如何使用元标签?什么是用在MVC meta标签的最佳方式?

I am working on mvc2. I want used Meta tags. I am new on the meta tags and seo. How can used meta tags on my page? What is the best way to used meta tags on mvc?

推荐答案

Meta标签在SEO这几天发挥了不断下降的作用。

Meta tags play an ever decreasing role in SEO these days.

不过,相对于MVC,可以大致如下设置你的母版了:

However, in relation to MVC, you can set your masterpage up along the following lines:

<head runat="server">
    <title>
        <asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    </title>
    <asp:ContentPlaceHolder  
        ID="MetaPlaceHolder" runat="server">
        <meta name="keywords" content="<%= ViewData["keywords"] %>" />
        <meta name="description" content="<%= ViewData["description"] %>" />
    </asp:ContentPlaceHolder>
    // lots os stuff missed out!!
</head>
<body>// more suff missed etc</body>

,然后从你个人的控制器动作以填充关键字和说明部分传递的ViewData。还有其他的方法,但是这一次是相当简单的启动和运行没有重大影响您的现有codeBase的。

and then pass the ViewData from your individual controller actions to populate the 'keywords' and 'description' sections. There are other ways, but this one is fairly simple to get up and running without major disruption to your existing codebase.

用法 - 以下内容添加到每个需要的控制器动作

usage - add the following to each required controller action

public ActionResult Index()
{
    // data would obviously come from some datastore but hardcoded for now below
    ViewData["keywords"] = "speed, camera, action";
    ViewData["description"] = "crime dun wrong";
    // other stuff happening too
}

这就是说,你应该更重要的是在看:

That said, you should more importantly be looking at:


  • 关键字密度

  • 出境/入境链接

  • IMG alt标签

  • 页面标题

  • H1 / H2含量

  • 长的URL细分和适用性

因为这些搜索引擎优化中扮演着越来越重要的这些日子。以上所有的应该是谷歌易于搜索。

as these play an ever increasing importance in SEO these days. all of the above should be easily searchable on google.

这篇关于MVC和Meta标签搜索引擎优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆