Meta tags are very much important for you web page, search engine use
Create a web application in c#
Drag a button and one textbox on the form
Then write code on form load event
C#
protected void Page_Load(object sender, EventArgs e)
{
HtmlHead headTag = (HtmlHead)this.Header;
// Set the page title
headTag.Title = "Title of Page";
// Add a Description meta tag
HtmlMeta PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Description";
PagemetaTag.Content = "Customized Description tag of the page";
headTag.Controls.Add(PagemetaTag);
// Add a Keywords meta tag
PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Keywords";
PagemetaTag.Content = "Customized Keyword tag of the page";
headTag.Controls.Add(PagemetaTag);
}
VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim headTag As HtmlHead = CType(Me.Header, HtmlHead)
' Set the page title
headTag.Title = "Title of Page"
' Add a Description meta tag
Dim PagemetaTag As HtmlMeta = New HtmlMeta()
PagemetaTag.Name = "Description"
PagemetaTag.Content = "Customized Description tag of the page"
headTag.Controls.Add(PagemetaTag)
' Add a Keywords meta tag
PagemetaTag = New HtmlMeta()
PagemetaTag.Name = "Keywords"
PagemetaTag.Content = "Customized Keyword tag of the page"
headTag.Controls.Add(PagemetaTag)
End Sub
This is the simple code to change meta tags of your page dynamically.
Good learning
ReplyDeleteSubmit your website or blog now for appearing in Google and 300+ search engines!
ReplyDeleteOver 200,000 websites indexed!
SUBMIT NOW with I Need Hits!