Digital Colony!

Creating an ASP.NET Blog Using Blogger

*** MARCH 2010 UPDATE: Blogger no longer supports FTP accounts.***

When I relaunched Digital Colony in January 2007, I made the decision to do it using Blogger. Prior to that this site used a publisher I wrote myself in Classic ASP. It did a fine job for years, but it didn't have comments or tags. Also, I've been using Blogger since April 2000, so I have a high level of comfort with it's interface.

Blogger Accounts

Before proceeding, I believe it's important to explain there are 3 levels of accounts that can use Blogger.
  1. BlogSpot Hosted - xxxx.blogspot.com
  2. Blogger Hosting Domain - your xxxx.com site is hosted on their servers.
  3. FTP Account - you manage your server and Blogger FTPs built pages to your site.
If you want to use ASP.NET, you will have use option #3. This means you will need your own disk space and FTP access. From this point forward, everything discussed applies only to Blogger accounts accessed via FTP.

Why Blogger? The Good Stuff

What I like about Blogger is you can use any file extension you like. This means I can use ASP.NET 2.0 and use Master Pages. I can also drop server controls onto my template. And I like the fact the code base resides on Google's server, not mine. If they need to update the publisher, they can without me having to download and install anything. Most blog tools require the user to install patches and perform upgrades.

The 2006 release of Blogger gave us tags. Blogger calls them labels, but it's the same concept. You can create an unlimited number of tags to quickly locate posts. Here is a link to all my posts with the tag Hexadecimal.

Things I Dislike About Blogger

Before you jump headfirst into using Blogger, let me make you aware of some of the bad things. As of July 2007, many of the Blogger markup tags do not generate XHTML compliant code. Prior to 2006 upgrade, all Blogger tags generated valid XHTML. I've brought this error to their attention numerous times but they have never emailed me back. For the most part Blogger no longer cares about their customers that use the FTP option.

This brings me to the second thing I dislike about Blogger. Their support is somewhere between awful and non-existent. It's July 2007 and the site still has some bugs that should have been fixed by now. Other publishers have bugs as well. But other publishers aren't owned by Google, which has a market cap of $168 Billion at this moment.

WordPress, SubText, Community Server?

Before I get a flood of emails, let me explain why I picked Blogger over other blog publishing tools. I made my decision to go with Blogger in December 2006. Some of my reasons have been addressed since then or will be soon.
  • WordPress - WordPress is the best blog tool. However it was coded for Apache using PHP. And although you can run it on a .NET server using IIS, you won't be able to use Master Pages or ASP.NET server controls. If you need a blog and you don't need .NET, use WordPress.
  • SubText - Unlike Blogger it has trackbacks, but it doesn't do tags the way I like. When you click on a tag on this site it goes to more posts on that topic on THIS site. Subtext handles tags by sending your readers off your site and over to Technorati. That was unacceptable for my needs. This project continues to get better. At some point I predict it will become the best .NET publisher.
  • Community Server - I downloaded and tested Community Server. It was a beast. Huge install, slow and full of errors. As a community builder, it may be tweaked to run fine. As a simple blog publisher it was lousy.
  • Other .NET Blog tools - I tested a few other .NET blog tools. Anything that was written using ASP.NET 1.x or didn't have tags was eliminated from consideration. Master Pages were introduced in ASP.NET 2.0, so using 1.x was not an option for me.
  • weblogs.asp.net - Microsoft offers a way for developers to post their blogs on their server. How nice of them. No thanks. DigitalColony.com is my asset and I will spend my time creating value for my domain, not theirs. If design frightens you and you are too cheap to buy a domain and pay for hosting, consider using them. Some of the best ASP.NET bloggers use them.

Overview on Creating an ASP.NET Blog on Blogger

  1. Sign up for a Blogger account.
  2. From the Blogger Dashboard, click the link that says Create a New Blog
  3. Skip the top of this screen and follow the link for Advanced Setup
  4. In addition to completing all the required information, make sure your blog filename is default.aspx.
  5. The next screen forces you to pick an ugly template. Hold your nose and pick one. You can change it later.
  6. From the settings tab, select the Archive link. Change the Archive Filename to archive.aspx.
  7. Create and publish dummy blog post. The post should have one label.
  8. NOTE: Blogger is not expecting the .ASPX file extension and will often post the first blog as .HTML regardless of how you set it up. Delete the dummy post.
  9. Create and publish the second dummy blog post. If you have all your paths correct, it should now be working. Test the home page, the post page, the archive page and the label page. If all is working well, you can delete dummy post number 2. You now have a working .NET Blog running on Blogger.

Master Pages and Getting Rid of the Ugly Template

Some of you will be happy with the template you selected. I bid you farewell at this point in the article. For the rest of us, the goal is now to setup a Master Page and make a nicer template.

Use Visual Studio to create your Master Page and Theme. Then when you are happy, go back to Blogger. From the Template tag, you are now going to step into the Edit HTML screen. Mixing Blogger markup and ASP.NET markup without the benefit of Intellisense or a debugger is tough. The process could take hours. Always backup changes to Notepad as you go.

Cool Looking Code and Extending Blogger

To get cool looking sample code, I use the Manoli.net formatter. And because your blog is in ASP.NET, you can add namespaces or create custom controls. A while back I wrote Blogger Label List for FTP Accounts (ASP.NET), which creates the control in the right column that displays all the tags and number of posts for that tag.

Last Thought

Some of you will give up and decide to use another blog publishing tool or live with one of the ugly templates Blogger provides. It all depends on what is important to you. Digital Colony uses Master Pages, the Yahoo! UI library for positioning, ASP.NET Themes, Imports a custom Namespace and has server-side controls in the template. All that is possible using Blogger.

Labels: ,

posted by MAS on Jul 6,2007

Digital Colony Copyright © 1999-2010 XHTML   508
Try...Catch Disclaimer: For brevity many examples do not include error handling. That is your responsibility.