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?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- MVC-Routing,Why i can not ignore defaults,The matc
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
From a programmer/technology point of view: meta tags are just tags.
What the content of your meta tags should be, and how to generate them, is application specific.
I think Jim is over-complicating it just a bit with the placeholder bit - it's not necessary. Just do this:
In _Layout head section:
In the controller:
Also no need to wrap it in a conditional; it won't throw an error. If you don't set ViewData in the controller the tag will just be empty:
Meta tags play an ever decreasing role in SEO these days.
However, in relation to MVC, you can set your masterpage up along the following lines:
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
That said, you should more importantly be looking at:
as these play an ever increasing importance in SEO these days. all of the above should be easily searchable on google.