seo issue - head / meta tag for .net master pages

Discussion in 'Site & Server Administration' started by mahendra rajeshirke, Jul 23, 2010.

  1. #1
    hi,

    i m doing seo on .net site, the site is www.ten.org.in.

    so there are one master page. and 4-5 sub pages(child pages). but the meta tag can be set in only master page., so the tag is applied to all pages. when the sub page is seen online browser, page take same meta tags.

    can i add <head> tag in body so i can solved the problem? or i have to find another solution by .net/aspx coding.

    ty in advance
     
    mahendra rajeshirke, Jul 23, 2010 IP
  2. skytide

    skytide Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you are using ASP.net 4.0, you can just do this in the content pages:

    Page.MetaDescription = "your desc"
    Page.MetaKeywords = "your keywords"

    in the Page Load event.

    If you are using older Asp.net, you can do this:

    Dim metaTag As New HtmlMeta
    Dim HeadTag As HtmlHead = CType(Page.Header, HtmlHead)
    metaTag.Attributes.Add("name", "description")
    metaTag.Attributes.Add("content", "your description")
    HeadTag.Controls.Add(metaTag)
    metaTag = New HtmlMeta
    metaTag.Attributes.Add("name", "keywords")
    metaTag.Attributes.Add("content", "your keywords")
    HeadTag.Controls.Add(metaTag)
     
    skytide, Jul 30, 2010 IP