Hi all,
I want to put meta tags only on the home page of my website. Can anyone tell me how to do it. The meta tags should not be seen on other pages of the website. Please explain me with an example too.
<meta name="description" content="@(Html.NopMetaDescription())" />
<meta name="keywords" content="@(Html.NopMetaKeywords())" />
<meta name="description" content="@(Html.NopMetaDescription())" />
<meta name="keywords" content="@(Html.NopMetaKeywords())" />
string currentpage=HttpContext.Current.Request.ServerVariables["PATH_INFO"];
if (currentpage == "/") {
<meta name="description" content="@(Html.NopMetaDescription())" />
<meta name="keywords" content="@(Html.NopMetaKeywords())" />
}
string currentpage=HttpContext.Current.Request.ServerVariables["PATH_INFO"];
if (currentpage == "/") {
<meta name="description" content="This is the special meta description only for home page" />
<meta name="keywords" content="These, are, the, special, meta, keywords, for, only, home, page" />
}
else
{
<meta name="description" content="@(Html.NopMetaDescription())" />
<meta name="keywords" content="@(Html.NopMetaKeywords())" />
}