The cool kids over on the other side of the fence always make these really cool "cheat sheets" for whatever bit of tech kit they're using and I fully expect someone with some good design skills to produce one for ASP.NET MVC.

You hear that Rob Conery?  Scott Hanselman?  How about you Phil Haack?  I fully expect Scott Guthrie, who is a Word among Bytes, to conscript some stylish hipster graphic designer to produce a masterful, stylish and yes, useful cheat sheet for the MVC masses at Mix '08, an event I sadly won't be attending because my company considers computers and those that make them work to be second class citizens.  I'm lucky if I get  to upgrade my IDE before the next one comes out much less attend an actual conference.  I've heard of conference swag but I've never actually received any of this mythical bounty.

Still, I desire, want and dare I say expect said cool cheat sheet.

Here are some examples for those that need some prompting and design ideas and to figure out just what in the hell I'm talking about:

1 Comments

I ported the CopySourceAsHtml to work with Visual Studio 2008.  There are some workarounds to get the existing addin to work with Visual Studio 2008 but they all assume you have 2005 installed, which I don't.  I recompiled from source, built against .NET 3.0, removed some crufty code thanks to FxCop and removed a call into olepro32.dll that wasn't needed.  I'll provide the updated source if anyone cares, this is just a quick posting as I'm flying out the door :)

To Install

  1. Download the CopySourceAsHtml AddIn zip.
  2. Unzip to \My Documents\Visual Studio 2008\Addins, if the Addins folder doesn't exist just create it.
  3. Restart Visual Studio (you did close it first right?)
  4. Right-click some selected code and you'll have a new Copy As HTML... menu item, that's the gold, click it. 
  5. Check the boxes in the dialog that comes up to your delight and then paste into your blog software or forum post.
  6. IMPORTANT: This Addin generates HTML code, so remember to switch into the HTML view in your blog software or forum edit box. 
  7. Bob's yer uncle

Sample

This is how a chuck of code looks when pasted (you'll notice it uses your exact color and font settings):

[Test]
public void Select_ColumnList_Specified()
{
    SqlQuery qry = new Select("productid", "productname").From(Northwind.Product.Schema);
    ANSISqlGenerator gen = new ANSISqlGenerator(qry);
  
    string selectList = gen.GenerateCommandLine();
  
    Assert.IsTrue(selectList == "SELECT [dbo].[Products].[ProductID], [dbo].[Products].[ProductName]\r\n");
}

The Source

UPDATE: I've finally zipped up the source and uploaded it by request.  Remember, I'm not the original author so all the good credit goes to someone else, I'm just the monkey that made it work on Visual Studio 2008.  Here it is for your enjoyment:

CopySourceAsHtml-2.1.0-Source.zip

3 Comments

Anyone that's using my Zune Marketplace Mp3tag source will probably want to upgrade to the latest version of Mp3tag, which as of today is 2.40!  I've been using the beta version for awhile and the tagging dialog is much better than in the original 2.39 release, easier to tag those albums where you only have a few of the tracks.

Get it from the official download site.

In a related note I've been using Mp3tag for about 2 years and I finally pulled the trigger and donated some dosh to this excellent free program.  Thanks to Florian Heidenreich for continuing to create such a great product!

0 Comments

I'm starting to see more ASP.NET MVC samples and questions come out and I'm realizing that a large portion of the ASP.NET crowd doesn't even realize that a huge reason for the MVC movement is because of the Ruby on Rails framework.  A lot of new .NET MVC developers are struggling with architectural questions that have already been debated and answered in the Rails community, which makes Rails a great resource for when you're first starting out or you're curious how to handle certain situations, like nested resources or how to structure your controllers.

Speaking of controllers one great thing from Rails that I hope more MVC developers embrace is REST.  Instead of repeating everything just watch David Heinemeier Hansson's keynote speech from RailsConf back in 2006.  Sure, it's almost two years but for ASP.NET developers it may as well be yesterday.  I'd suggest starting from the second part since the first segment is just normal conference ra-ra-ra.

Check it out here (don't forget to download the slides that he refers to here).

Note

He talks about using a semi-colon in the URL to denote an aspect/action of a controller, like this:

/people/1;edit

Well, you can ignore that and just assume he *really* meant to say:

/people/1/edit

They dropped that semi-colon silliness in Rails 2.0 and it feels much cleaner.

2 Comments

Designed by Free CSS Templates. | Sign in