How to add Meta Keywords on web page?

 Posted by vishalneeraj-24503 on 12/1/2014 | Category: ASP.NET Interview questions | Views: 1424 | Points: 40
Answer:

First import System.Web.UI.HtmlControls Namespace at the top of the page.
using System.Web.UI.HtmlControls;

HtmlMeta meta_keywords = new HtmlMeta();
meta_keywords.Name = "keywords";
meta_keywords.Content = "Dotnet funda.com";
Page.Header.Controls.Add(meta_keywords);


Output:-
When run the page,and viewing page source,then we can see Meta Keyword as shown below:-

<head><title>
</title><meta name="keywords" content="Dotnet" />
</head>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response