Tuesday, March 29, 2011

adding META data when using master page?

Step 1: In your master page define this:

....

< head>
< asp:ContentPlaceHolder ID="ContentSEO" runat="server" />
< meta http-equiv="content-type" content="text/html; charset=utf-8" />
< meta http-equiv="content-language" content="en" />

...

....


Step 2: Now within the child pages, add this:

< %@ Page Language="VB" MasterPageFile="~/masters/Default.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="home_Default" Title="Untitled Page" %>
< asp:Content ID="ctlSEO" ContentPlaceHolderID="ContentSEO" runat="server">
< title>Your title< /title>
< meta name="Keywords" content="your,keywords" />
< meta name="Description" content="Your Keywords" />
< /asp:Content>
......

1 comment:

  1. But i have a doubt on uploading meta on master page. Shall it be good practice to get ranked in search engine.
    XBRL Software

    ReplyDelete

Ajax CalendarExtender displaying at wrong position in Chrome

< script type ="text/javascript" language ="javascript">     function onCalendarShown(sender, args)...