asp.net mvc 3 - MVC 3 Razor Meta Description / Keywords -


what simplest way of getting meta description / keywords onto _layout page? similar how page title nice. such as

<title>@viewbag.title</title> <meta name="keywords" content='@viewbag.keywords'/> <meta name="description" content='@viewbag.description'/> 

my view like:

@{     viewbag.title = "contact me";     viewbag.keywords = "my, keyword, list, etc"; } 

your view should not responsible of (do not add logic views). instead, it's action method should specify meta information.

check answer here: asp.net mvc - strategy including seo information such meta keywords , descriptions

the answer still apply, although should use viewbag instead of viewdata.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -