Inspired by Ruby on Rails

Instead of vegging out on TV after work today, I decided to veg out on the web.  Between reading and IM I managed to kill about 2 1/2 hours before I even noticed.  The payoff for this exercise was discovering a little project called the .NET Action Pack.  Rob Conery has taken the concepts of Ruby on Rails and reimplemented them using C# and .NET 2.0.  The screencast he used to demonstrate the action pack was quite impressive.  With a build provider, a configuration file, and a single assembly, you get a whole host of classes that let you query and manipulate a database however you wish that are available at design time.
I’m definitely going to try this out at work tomorrow.

Visual Studio 2003 Service Pack 1

Somehow I completely missed this announcement about the Visual Studio 2003 service pack being released.  Our group at Lockheed Martin won’t be upgrading to Visual Studio 2005 until 2007 at the earliest, so it looks like I’ll be installing this service pack very soon.  Apparently, Microsoft found quite a few bugs that needed fixing.

Downtime

I haven’t blogged in awhile since finishing my latest project, pushingback.com. My employer sent me off to Cognos 8 training last week. I’ve spent the rest of the time doing what I can to fill in the void between billable projects. My boss tries to fill in the time by assigning me tasks like documentation, and creating PowerPoint presentation on this or that flavor-of-the-month technology. The latest such assignment is to lead a project to create a web application our clients can use to communicate with us about past, present, and future projects.

My employer was very cheap concerned about the impact on the budget, so when it came time to implement an internal solution for defect/issue tracking back in 2004, we chose to customize the ASP.NET IssueTracker starter kit (I’ve discussed this earlier) instead of dropping some cash on FogBugz or Bugzilla.

Now that my boss has suggested looking at COTS or open source solutions (again), I’ll be spending at least some of this downtime trying to find an improved solution.

ASP.NET 2.0 Membership

Today I’ve been spending a bit of time fiddling around with Visual Studio 2005, particularly the ASP.NET 2.0 membership functionality. When I visited 4GuysFromRolla.com to see what they had to say about it, I came across 5-part series of articles. The examples are in VB.NET, so I’ve been rewriting them in C# (my preferred .NET language) as I go along. What stood out about their information message example in part 4 of the series was that they added a label to their login page and set the text string based on the error details.

It seemed to me that there should be a property in the Login control that could be set programmatically instead of adding a label that results in two error messages for the user to look at. It didn’t take much digging before I found it. The property: FailureText.

Here’s how my revised code looks:

protected void Login1_LoginError(object sender, EventArgs e){

MembershipUser userInfo = Membership.GetUser(this.Login1.UserName);

if (userInfo == null){

//The user entered an invalid username...

SetLoginFailureText(string.Format("No account exists with the username '{0}'.",this.Login1.UserName));

} else {

if (!userInfo.IsApproved){

SetLoginFailureText(string.Format("The account with the username '{0}' has not yet been approved by the site's administrators.", this.Login1.UserName));

} else {

if (userInfo.IsLockedOut){

SetLoginFailureText(string.Format("The account with the username '{0}' has been locked out.", this.Login1.UserName));

}

}

}

}

private void SetLoginFailureText(string failureText){ this.Login1.FailureText = failureText; }

Effective Bug Reporting

This has been a real problem at work lately. I’ve decided to write a document to send to people who report bugs to try and stem the tide of useless “it doesn’t work” reports. I found a nice long piece on effective bug reporting by Simon Tatham here. I’ll probably use it as a reference for further reading because I envisioned something much shorter than seven pages.

Community Server 2.0 Quick Image Buttons

The blog I’m building for a client at work needed an image button to trigger searches instead of the standard link button. After my ill-advised attempts to extend CommunityServer.Controls.IButton, the consultant I’m working with recommended a far simpler solution–changing the ASP.NET LinkButton tag to enclose an HTML image tag with the border attribute set to zero (0).

If you want to use the same technique, start with this sample skin file.

A “Most Viewed Blog Posts” control for Community Server 2.0

The Code Project is one of my favorite sources for finding out how to do things on the .NET platform.  Since my blog was down for a bit a couple days ago, I thought I’d put an article there on the latest bit of customization I’ve done to Community Server.  If you’re interested in the article, visit this link to read it.

Changing File Upload Limits in Community Server 2.0

I wanted to see how much effort it would take to replace this RSS feed with a CS 2.0 blog. It’s currently being generated by an old ASP application that I customized with a colleague of mine. But I kept getting errors when I tried to upload MP3 files above a certain size. A bit of googling revealed this MSDN entry and the attribute “maxRequestLength”.

RSS Publishing

It shouldn’t be a big deal at all with apps like Community Server 2.0 or WordPress available, but budget and/or personnel constraints often conspire against us using either one. So lately, we’ve spent more time (and money, but salaries apparently don’t count) putting together custom applications to generate RSS feeds.

I always check to see if a solution to my problem already exists before building my own, so when it came time to develop the MethResources.gov RSS feed, I simply reused the example from this article by Scott Mitchell. Behind the ONDCP podcast (I did the database work, a colleague did the rest) is a classic ASP application with the most basic admin functionality.

To cut down on this sort of one-off RSS app building, I’ve been hunting around for any bits of code or fully-formed toolkits that could be reused easily. The latest interesting bit of code I came across is the ASP.NET 2.0 RSS Toolkit. It’s from a Microsoft employee, and most comments I’ve read on it have been positive. Of course, when I tried to get the samples to work, I had all kinds of problems. The solution was to create a new website project (with location = “File System”) , browse to the samples directory of the toolkit, and open the existing website. Once I did this, and added RssToolkit.dll to the GAC, all six scenarios worked perfectly.  The two examples I tried from Scott Guthrie’s blog entry on the toolkit worked also.

The only things I haven’t found in this toolkit so far are support for enclosures and an easy way to syndicate a database.

ASP.NET Calendar Customization

My latest assignment is to help redesign this website into a true blog for the office of the drug czar. We’re using Community Server 2.0, and one of our requirements is to customize the calendar. Since the CS 2.0 calendar is a wrapper around the stock .NET framework one, I put together a Word document to explain the customization process to the graphic designers who are actually responsible for the look-and-feel of the calendar. My hope is that they’ll understand it well enough to reduce my workload when it comes time to implement this.

The document applies pretty well to calendar customization in general for ASP.NET 1.1 projects.

I created an RTF version and an HTML version of the content as well.