Standardized ASP.NET MVC Controller Actions with Visual Studio Item Templates

Originally published: 09/2008 by J Wynia

First, I think that this may be the longest title for any post on this site. I ditched 2-3 other variations for the only one that accurately describes this post.

Anyway, over the last couple of months, I've been working on getting better with screencasting tools. I learned a lot doing the last one and took that into the tinkering I've done with another one over the past week or so.

It stretched out over that timeframe because of a bunch of other stuff going on as well as some time spent on one-time tasks, like creating a Keynote theme to use for future screencasts that's a bit better thought out than the one I used on the last screencast. This look is something I'm much happier with and gives me a basis for more consistent look and feel going forward.

There's none of my shining face because I lent my webcam to a friend. I do see the value in adding that to the recording, but am not sure the best way to do it.

Anyway, on to the topic I actually covered in this video.

In ASP.NET MVC, the Controllers often end up with an Action method for all of the really common bits of functionality: Create, Insert, Update, Delete, etc. Stephen Walther put together a list of suggested standardized naming and usage for these Actions and I've been using them in the couple of ASP.NET MVC projects I'm working on.

In the process, I created a Visual Studio Item Template to make creating a new Controller that follows that convention easy. When I showed it to a co-worker, he expressed interest in how I did it and I saw an opportunity to explain something that's actually useful.

So, if you've ever wondered how to get your own templates into that Visual Studio "Add New Item" dialog box next to "Class Library", "Application Config File", etc. This is the screencast for you.

Anyway, give it a watch and let me know what you think.


Creating Visual Studio Item Templates from J Wynia on Vimeo.

Comments

Jarrett on 9/8/2008
Nice job. I really enjoyed the content and look n' feel. The video quality is also very nice. The audio quality started out great but during the code portion had clipping static. Again, great job and thanks for teaching me about the file -> export template action.
J Wynia on 9/11/2008
Thanks. I think I was leaning too close to the microphone when I recorded the Visual Studio bit. This was actually recorded in 3 separate sessions. I'm hoping to not need to do that for the next one. I'm also trying to figure out a way to set up my big podcasting microphone instead of the cheap USB mic I used for this one to get the audio better. On the first one, I didn't notice that the audio settings in Camtasia were set to basically "phone" quality. I guess it's just an incremental process where you move forward with each one you do.
J Wynia on 9/11/2008
I probably would have re-recorded that segment, except that was my 5th attempt and I wanted to be done. Between the file getting eaten and my wonderful dogs deciding to add their voiceover to the mix, I was just happy that I got through it without major problems and went with it.
Atock on 11/12/2008
One recommendation that has nothing to so with the content on this site. The background on your site looks great and really complements the page. Maybe it's just personal preference but one line of extra CSS would really add a little something to your page: background-attachment:fixed; Put that on line 13 of your styles.css file. I'm sure you'll love the change when you scroll and the background stays put. Again, perhaps it's just preference, but hey, that's what the web is for.. opinions.
blog comments powered by Disqus
Or, browse the archives.
© 2003- 2014 J Wynia. Very Few Rights Reserved. This article is licensed under the terms of the Creative Commons Attribution License. Quoted content or content included from others is not subject to that license and defaults to normal copyright.