A simple way to catch inconsistency in your titles
Page Titles are often overlookd aspects of web design and can be a simple way to add a little value and professionalism to your site.
Users can use your page title to quickly scan bookmarks or on tabs in their browser.
Therefore, I feel it is good practice to have a consistent page title naming scheme across your site.
Often I seem to screw up making titles for my pages or forget to add one altogether, or even worse, have the dreaded 'Untitled Page' that was ever=resent before VS2008 SP1. I use MasterPages
so there is a centralized structure to build on, and I used this to come up with a way to provide a consistent page title:
string TITLE_ROOT = "My Site";
protected void Page_Load(object sender, EventArgs e)
{
this.Page.Title = (string.IsNullOrEmpty(this.Page.Title) || this.Page.Title.Equals("Untitled Page"))
? TITLE_ROOT : TITLE_ROOT + " :: " + this.Page.Title;
This way, any page that uses this MasterPage will have a nicely formatted title. If you forgot to set a title it would simply be:
My Site
But, say you titled the page "Welcome New Users!", it would then look like this:
My Site :: Welcome New Users!
An easy way to catch myself from making mistakes as well as making it much more consistent.