First Assign a id in header section of a Master file like
<head runat="server" id="main-Master-Header" />
Now to Access the id of Main Master page in any page at the page load event like
HtmlHead hdMain = (HtmlHead)Page.Master.FindControl("main-Master-Header");
Now Creating the object of HTMLMETA
HtmlMeta htmMeta= new HtmlMeta();
Then assign the type of meta tag to the variable and content also... like
htmMeta.Attributes.Add("name","description"); htmMeta.Attributes.Add("content", "Cornerstone REO Services provides a wide variety of Asset Management Services to valued clientele by creating peer to peer, first generation relationships, to assist them in the timely, systematic solution to their REO management needs. Our service area encompasses all 21 New Jersey Counties.");
Now Adding the Meta Tag in the Header Section... like
hdMain.Controls.Add(htmMeta); //Adding keyword Meta Tag to Head Section HtmlMeta hm2 = new HtmlMeta(); hm2.Attributes.Add("name", "keywords"); hm2.Attributes.Add("content", "REO Services, Asset Management, New Jersey Counties"); hdMain.Controls.Add(hm2);
//Adding title Tag in the Header Section... like
HtmlMeta titleHTMLMeta = new HtmlMeta(); titleHTMLMeta.Attributes.Add("name","title"); titleHTMLMeta.Attributes.Add("Content", "REO Services, Asset Management, New Jersey Counties Cornerstone"); hdMain.Controls.Add(titleHTMLMeta);
AttachmentsChanging Dynamically allocate Title, Meta Keywords and Meta description in to a Page (34490-291727-Code-for-Adding-Meta-Keywords-and-Description-to-Site-in-C-Sharp.txt)
|
No responses found. Be the first to respond and make money from revenue sharing program.
|