Welcome to AspAdvice Sign in | Join | Help

Finding Untitled Page Titles

Sadly, Microsoft decided that with the addition of the Title attribute on the @Page directive, it would make sense to include it by default with some text that one would absolutely never want to use as the title, "Untitled Page".  They could have named it "Customer Reporting" or "My Britney Fan Page" and it would have been correct some small amount of the time - but instead they chose something about as likely to actually be useful as Class1.cs or WebForm1 (thankfully WebForm1 is gone and new projects start out with Default - thank you, Microsoft!).

You can edit your page template yourself, of course, but almost nobody does.  You can see that Untitled Page is an epidemic by doing a simple google search limited to "Untitled Page" in the title of the page

allintitle:  "untitled page"

This returns about 1.3M pages, and while not all of them can possibly be ASP.NET pages, I'm betting a lot of them are.  You can refine this search further, for instance, to see how many of Microsoft's own pages suffer from this default title, by using the site: parameter in your search.  This search will show the 1500 or so pages on Microsoft.com that have "Untitled Page" in their page title:

allintitle:  "untitled page" site:microsoft.com

Now, it would be great if the default title were removed - that's what I would like to see and part of the reason for this post.  And in fact I should credit Plip for mentioning this issue on a discussion list we're both on, but I wanted to take it a step further by showing developers how to find and correct this problem in their own sites in a fairly easy manner.  The way to find out if your site is suffering from an infection of Untitle Page-itis is to do exactly what I did for the microsoft.com site above, but replace that domain with your own.  For instance, I immediately wanted to see if any of these had slipped by me for Lake Quincy Media's web site, the .NET advertising company I co-own.  So I ran the following search:

allintitle:  "untitled page" site:lakequincy.com

And thankfully, came back with nothing.  Now that doesn't mean some password protected page here or there isn't still using the default tag - I can do a search in Visual Studio for the string as well.  But this is more of an issue in public-facing pages, especially since page titles still get extra weight from search engines, so it's a good idea to put something useful in there for SEO purposes.  If you've recently (say, since 2005) built an ASP.NET site, you may want to run this quick check to see if any of your pages went live without a useful title, so that you can correct the problem.  If you want to take care of it at its source, replace your Web Form template in Visual Studio with one that doesn't automatically set the Title attribute.  Alternately, in your base page class, add something to the PreRender event handler that detects if the Title is set to "Untitled Page" and have it throw an exception.  That should keep these from making it into production, too, if you want to be really sure about it.

 

Related Posts:
Ultimate ASP.NET Base Page Class

Published Tuesday, January 29, 2008 12:05 PM by ssmith
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Daily Find #26 | TechToolBlog

Wednesday, January 30, 2008 12:34 PM by Daily Find #26 | TechToolBlog

# 本周ASP.NET英文技术文章推荐[很久以前 - 02/26]:

摘要坚持下来,继续推荐。本期共有7篇文章:MaartenBalliauw介绍的ASP.NET负载均衡以及ASP.NET的StateServerVS2008WebDeploymen...

Friday, February 01, 2008 9:33 AM by Dflying Chen

# 【收藏】本周ASP.NET英文技术文章推荐[01/27 - 02/02]:负载均衡、State Server、Web Deployment、Data Entry Suite、GridView、Access、SQL Server、MSDE

摘要

坚持下来,继续推荐。本期共有7篇文章:

MaartenBalliauw介绍的ASP.NET负载均衡以及ASP.NET的StateServerVS2008WebDeploymen...

Saturday, February 02, 2008 8:33 PM by Jacky_Xu

# re: Finding Untitled Page Titles

It is funny, I actually did a search for "Untitled Page" just for fun, and your site was the fifth one down the list, being that was what your article was about.  I actually go about fixing this in an overly complicated manner, instead of using Web.UI.Page, I have my own derived class, that I do a

if (! this.Title.Contains(m_sitename))

{

  this.Title =  (String.IsNullOrEmpty(m_PageName)) ?

     m_sitename : m_sitename + " :: " + m_PageName;

}

because normally, I make all my pages titles something like "SiteName  :: PageName" for consistancy.  If the site name isn't in the title, then I forgot to set it, and it gets set automatically.

Monday, August 04, 2008 10:55 PM by STephen Bayer

# re: Finding Untitled Page Titles

For SEO purposes, it's better to put the page title first, then the site name.  Search engines looking for keyword will look at the first however many characters in the title for keywords, so the page title is better at the beginning than the end, especially if you have a very long site title.

I see that my blog here on AspAdvice doesn't follow this advice... I blame community server (which I didn't write)...

Tuesday, August 05, 2008 11:27 AM by ssmith

Leave a Comment

(required) 
required 
(required) 
Enter the code you see below