Setting Meta tag through page directive in ASP.NET 4.0...

 Posted by Bharathi Cherukuri on 8/29/2012 | Category: ASP.NET Interview questions | Views: 2859 | Points: 40
Answer:

Met tags are used to give the basic information about a web page like page title, page description, page keywords and more.
These Meta tags can be set directly through page directive as shown in the below code snippet.


<%@ Page Title="Your Page Title" MetaDescription="Your Page Description" MetaKeywords="Your Page Keywords" Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Sandy's on: 8/30/2012 | Points: 10
nice...by above method we can set meta tags only in static way.
Dynamically we can insert meta tags in this way..
in .cs file we need to write code like this
Page.Title = "Your Page Title";
Page.MetaDescription = " your page Description";
Page.MetaKeywords = "Keywords";
this advanced futures works in .net framework 4.0.

thanks.. :)

Login to post response