Saturday, December 19, 2009

How to add a meta tag to a "child" ASP.Net page.

I usually use a master page for creation all pages in my inventory software projects. It's a good way for fast creation web pages but I had only one problem. I could not edit meta tags in project's pages because we don't see the "head" section of child pages. But search engines like to see different "description" tags on all pages. You can add any meta tag on your page using the next code snippet in the Sub Page_Load :
Dim metaTag As New HtmlMeta, metaTagD As New HtmlMeta
metaTag.Name = "keywords"
metaTag.Content = "inventory software,systems"
Header.Controls.Add(metaTag)
metaTagD.Name = "description"
metaTagD.Content = "List Receiving orders or item receipts,inventory software,systems"
Header.Controls.Add(metaTagD)

It is a simple and workable solution.You have to enter an appropriate description and keywords for each your page.

No comments:

Post a Comment