Using web.sitemap to hold SEO meta data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    #1

    Using web.sitemap to hold SEO meta data

    here's what i've got so far in my code beind

    if (SiteMap.Curren tNode != null) {
    if (SiteMap.Curren tNode["metaKeywor ds"] != null)
    {
    strMetaKeywords = SiteMap.Current Node["metaKeywor ds"];
    strMetaDescript ion = SiteMap.Current Node.Descriptio n;
    }
    else
    {
    strMetaKeywords = "this is a test";
    }
    }

    if (!Page.IsPostBa ck)
    Page.DataBind() ;
    }


    So, it pulls Description and metaKeyword from the siteMapNode and
    populates the webform meta tags. It work well. What i'm not sure how
    to do is populate steMetakeywords or strMetaDescript ion with content
    if there is no siteMapNode for a given web form (that's what i'm
    attempting to do in the ELSE statement).

    any ideas?
Working...