Today in my blogpost I am going to discuss about dynamic ASP.NET master page search engine optimisation. Master page is a feature in ASP.NET that helps website to keep the site layout consistent throughout all the website. Any changes to the website can be made at a single point if master pages are used. The main issue while creating master pages are that the title and meta tags will be same throughout the website as well. To avoid the same we should add Unique Title element to the content pages and Meta tags to seperate Code behind Webforms (example index.aspx.cs file).
The code for Title in Content pages is
@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="_Default" Title="Untitled Page"
Replace the Untitle Page with appropriate Title.
Here is the code for webforms
In your Content Pages you need to find the Master Page Control head1, to find that use the following code:
HtmlHead header = (HtmlHead)Master.FindControl("head1");
Now that you have your header you can add controls to it using the header.Controls.Add method. Create an HTML Meta DescriptionTag now and add it to your header:
HtmlMeta description = new HtmlMeta();
description.Name = "Description";
description.Content = "This is the description associated with this content page";
header.Controls.Add(description);
Make sure that you are using head1 and runat="server" attribute in your Master Page.
Cijo Abraham Mani is a regular blogger on GSEO. He is currently working as Manager(Online Marketing) in a reputed software firm. He also does freelance work for florida based orthopaedic associates. He is a leading social media consultant and strategist and can be found at Linkedin and on Twitter.









































