سؤال

What is the simplest way of getting meta description / keywords onto my _Layout page? Something similar to how you get the page Title would be nice. Such as

<title>@ViewBag.Title</title>
<meta name="keywords" content='@ViewBag.Keywords'/>
<meta name="description" content='@ViewBag.Description'/>

My view would look something like:

@{
    ViewBag.Title = "Contact Me";
    ViewBag.Keywords = "My, keyword, list, etc";
}

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top