<html xmlns="http://www.w3.org/1999/xhtml" > <head> <title> Rhinoback Professional Secure Online Backup Services for Small and Medium Business - SMB </title> <meta name="description" content="Professional Online Backup Services. Rhinoback provides robust backup functionality at affordable prices. Premium features, premium services, low prices. Get the most for your money with Rhinoback!" /> <meta name="keywords" content="backup, online backup, secure backup, cheap backup, free backup, offsite backup,internet backup, secure files, offsite data storage, privacy, security, features, low prices, premium service, remote backup" /> </head> <body> </body> </html>
The text from the
The meta description text is displayed by the search engine when your page is listed. The example below is from a Google search. The text below the underlined title comes directly from the meta description tag. Without a meta description tag, your page may be listed with a description that was extracted from text found somewhere on the page. It is always better to specify the text for the description of each page rather than leave it up to a search engine robot.
Master Pages were introduced in ASP.NET 2.0 and have proven to be a valuable feature. This article does not attempt to explain the details of master pages or how to implement them, that is well covered in numerous other articles. When using master pages the
<%@ Page Language="C#" MasterPageFile="~/PageTags.master" AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" Title="My home page title" %>
The @Page directive above is from a content page in an ASP.NET 2.0 website that uses a master page. As discussed above, you may need to specify some meta tags at the content page level rather than at the master page level. You may have discovered that the @Page directive does have a Description attribute, however, it does not create a meta description tag for your page. In fact, anything that you specify on the Description attribute is completely ignored and not used for anything.
In my case, it was completely unacceptable to have the same description on all pages of my site. I also wanted to specify keywords for each page that may vary from page to page. My first cut at a solution to this problem involved using the code-behind to insert the desired meta tags onto each pages'
protected void Page_Load(object sender, EventArgs e) { HtmlMeta tag = new HtmlMeta(); tag.Name = "description"; tag.Content = "My description for this page"; Header.Controls.Add(tag); }
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim tag As HtmlMeta = New HtmlMeta() tag.Name = "description" tag.Content = "My description for this page" Header.Controls.Add(tag) End Sub
The problem with this solution is that the title of the page, the meta description, and the content of a page are all related and I really want the title and description to be together and also in the same ASPX file as the content. The Page_Load method can easily be placed within
Page_Load