ASP.NET - meta tag - Asked By msakt on 28-May-12 02:32 AM

how to add title tag,description and keywords tag in meta tag in
TSN ... replied to msakt on 28-May-12 02:39 AM


you can do in this manner

<head runat="server">
   <title>Your Page Title</title>
  <meta name="description" content="Your Page Description" />
   <meta name="keywords" content="Your Page Keywords" />


in the page load event

 Page.Title = "Your Page Title";

Page.MetaDescription = "Your Page Description";
Page.MetaKeywords = "Your Page Keywords";


Somesh Yadav replied to msakt on 28-May-12 02:41 AM
check this,
Suchit shah replied to msakt on 28-May-12 03:16 AM
ASP.Net 4 adds 2 new Meta tag related properties to the Page. They can be used to set meta tags for keywords and description.

You can set them in the code behind with below code like:

Page.MetaKeywords = "keyword1, keyword2, keyword3";
Page.MetaDescription = "Example of new meta tag support in ASP.Net 4";

You can also set in the @Page directive:

<%@ Page Language="C#" AutoEventWireup="true"
MetaKeywords="keyword1, keyword2, keyword3"
MetaDescription="Example of new meta tag support in ASP.Net 4"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

So this are the 2 way with that you can able to set the meta tag
Jitendra Faye replied to msakt on 28-May-12 03:23 AM
Simply add Meta tag inside HEAD tag like this-

<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
<meta name="author" content="Hege Refsnes" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
Goniey N (Mr. G) replied to msakt on 28-May-12 05:18 AM
You can add Meta Tags into the HEAD section.

using the name attribute you can define the description as well as keywords.
using content write the value of given attribute.
See Below Code :

<head runat="server">

    <title>This is My Site</title>

    <meta name="description" content="Enter Description">

    <meta name="keywords" content="Enter Keywords">


Hope this will helpful to you....