C# .NEt - Developer Resourses - C Sharp Append Meta Keywords Description To Master Page ::: Lionfish Tehcnologies



Home / Developers Resourses / Tips

C# Append or Add Meta Keywords or Description To Master Page

It is a very simple solution and it works also if you want to replace the entire meta tag information


Write the commons keywords and keywords on Master Page (client side)

<head runat="server">
	...
    <meta name="keywords" content="common word master, common description master, common keyword on master page" ⁄>
    <meta name="description" content="common description master, common description additional master, common keyword on master page" ⁄>
    ...
<⁄head>


On the Code-behing of the Content Page (Child page)

...
public partial class ChildPage : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    // !! Important start with a comma because we are going to append
    Header.Keywords += ",specific keyword on content page, child page keyword, more information here";
    Header.Description += ",specific keyword on content page, lionfish techonologies custom web application development, more information here";
  }
}
....





Lionfish Technologies ® 2009 All rights reserved