Contents tagged with ASP.NET MVC
-
Looking Forward to 2010
Yes, the first month of 2010 is almost gone and I'm just now getting around blogging about the past year and the year ahead. I guess time management should be on my to-do list for this year?
-
Using Windsor to inject dependencies into ASP.NET MVC ActionFilters
I'm using Windsor as my IoC container for an ASP.NET MVC application. To get dependency injection in my controllers, I'm using a slightly modified WindsorControllerFactory from Andre Loker's post earlier this year. It works great and allows me to easily test my controllers.
-
Strongly Typed Session Variables in ASP.NET MVC
This post was originally going to be a comment on Jarret@Work's blog post about "Using Extension Methods for Session Values", but I decided to make a full blog post out of it. Jarret employed extension methods such Bar()/SetBar() and Foo()/SetFoo() to have strongly-typed session data. While his method certainly works, I've taken a different approach that I think is a bit more flexible and reads better.
-
Handy Extension Methods for ASP.NET MVC's UrlHelper
Mickael Chambaud posted three extension methods he created for UrlHelper: Image(), Stylesheet() and Script(). They make it pretty easy to keep your images, stylesheets and scripts organized in a single location – without the need for you to remember where they are placed. And if you need to move things around for some reason, you only have to change the extension methods.
-
ASP.NET MVC + MVC Contrib + Unit Testing
One of the key benefits of the MVC (Model View Controller) pattern is a separation of concerns that leads to better testability. Microsoft recognizes this and will automatically create a separate MS Test project when creating a new ASP.NET MVC solution. While this gives you a nice head start, there's room for improvement. While actions in the MVC pattern are simply methods on a class that can easily be called by MSTest (or any unit testing framework), most web applications have interactions with supporting objects such a Request (query string, form parameters, etc…), Response (cookies, content type, headers, etc…), Session, and more. In a live environment, these objects come as a result of the HTTP request being processed by IIS. In a test environment, you're isolating just your controllers and actions and you don't have IIS and an entire HTTP pipeline.
-
Know Your Environment!
This is probably one of the most embarrassing things I've admitted to in public (well, maybe not – but close). I really had to think about whether I wanted to post this. The mentor in me said "You need to post this. Others may run into this situation and this will help them." But the rest of me was saying "You can't admit to that!" The mentor in me won out and I'm posting this in the hopes it may save someone else a few hours of headaches.
-
Lansing Day of .NET 2009
Last Saturday (August 1st) was Lansing's Day of .NET. The guys organizing this did a great job and I had a really fun time. I gave my "Intro to ASP.NET MVC" presentation. I got some great questions during the presentations as well as good feedback. I did have a few questions that I wanted to follow up on:
-
ASP.NET MVC and Resolving Controllers with Windsor
Last week, while working on an ASP.NET MVC app, I wanted to plug in Windsor and use IoC to resolve my controllers. A couple of Google searches and I came across Andre Loker's blog where he describes step-by-step how to achieve this – and it was just about a week ago! What timing!
-
ASP.NET MVC Goodness!
Last week at AADND, I gave a presentation on MonoRail, the Castle Project's MVC implementation on ASP.NET. The MVC pattern is so popular (and productive!) among web developers, I'm sure you're aware that Microsoft is working on ASP.NET MVC – which is now up to RC1.