Add meta tags in content pages under master page:
Master page:
<head runat="server">
<asp:Literal ID="ltrCtrl" runat="server"></asp:Literal>
</head>
Normal/ChildPage:
Sample.aspx.cs Page on pageload
Literal ltr = (Literal)this.Master.FindControl("ltrCtrl");
StringBuilder metatag = new StringBuilder();
metatag.Append("<meta name=\"description\" content=\"description here. \" />");
metatag.Append("<meta name=\"keywords\" content=\"keyword, keywords here\"/>");
ltr.Text = metatag.ToString();
i am using this .. its working fine for me.
No comments:
Post a Comment