This is how meta tags are set dynamically:
HtmlMeta mKey = new HtmlMeta();
mKey.Name = “keywords”;
mKey.Content = “home, blog”;
this.Page.Header.Controls.Add(mKey);
HtmlMeta mdesc = new HtmlMeta();
mdesc.Name = “description”;
mdesc.Content =”home page”;
this.Page.Header.Controls.Add(mdesc);
after doing that you can view in the “View Source” of the page you have set meta tags under the head section.
<meta name="keywords" content="home,blog" /> <meta name="description" content="home page" />
No comments:
Post a Comment