Set meta tags with asp.net
Friday 02 October 2009
If you would like to set the meta tags of your page without using repeaters, then here's how to do it:
1) Insert the below meta tags into your page (notice the id and runat attribute):
- <meta name="description" content="description" id="MetaDescription" runat="server" />
- <meta name="keywords" content="keys" id="MetaKeywords" runat="server" />
If you're using a master page, set a ContentPlaceHolder, just below, within the master page:
- <asp:contentplaceholder ID="ContentMeta" runat="server" />
So if you are using a master page, this is how your meta tags should look:
- <asp:content ID="Content1" ContentPlaceHolderID="ContentMeta" Runat="Server">
- <meta name="description" content="description" id="MetaDescription" runat="server" />
- <meta name="keywords" content="keys" id=
|
(0)
|
|
|