I am working on MVC3, I am using Razor engine i have a layout.cshtml page which contains meta tag like
<meta property="og:url" content="http://www.mywebsite.com/" />
I have some content pages like abc.cshtml which has Layout.cshtml page as there’s layout,so they are getting meta tags from layout.cshtml,i want that abc.cshtml should have its own meta tag like
<meta property="og:url" content="http://www.mywebsite.com/controller/abc" />
How can i do this? OR can i change meta tag dynamically??????
Yes you can pass that value from each or view action in ViewBag like below…
then in you layout.cshtml
or set above head tag in you layout.cshtml..
and add in your view…