Subscribe to this Blog

Subscribe to this Blog

Stephen Walther on ASP.NET MVC

Recent Posts

3
Comments

ASP.NET MVC Tip #24 – Retrieve Views from Different Folders by swalther

In this tip, I demonstrate how you can retrieve a view from any folder in an ASP.NET MVC application. I show you how to use both specific paths and relative paths. Until today, I thought that a controller action could return a view from only one of two...
Filed under: , ,
6
Comments

ASP.NET MVC Tip #23 – Use POCO LINQ to SQL Entities by swalther

In this tip, I demonstrate how you can create LINQ to SQL entities that do not contain any special attributes. I show you how you can use an external XML file to map LINQ to SQL entities to database objects. I’ve talked to several people recently...
Filed under: , ,
11
Comments

ASP.NET MVC Tip #22 -- Return a View without Creating a Controller Action by swalther

In this tip, I demonstrate how you can eliminate controller methods that simply return views. I show you how to use the HandleUnknownAction method to handle every request against a controller automatically. I saw Phil Haack use the following tip in a...
Filed under: , ,
7
Comments

ASP.NET MVC Tip #21 – Fake the Data Context by swalther

In this tip, I demonstrate how to create an in-memory data context class that you can use when unit testing ASP.NET MVC applications that access a database. In this tip, I explain how you can write unit tests for data access code within an ASP.NET MVC...
Filed under: , ,
3
Comments

ASP.NET MVC CodePlex Preview 4 by swalther

Fantastic! A new version of the ASP.NET MVC framework was released on CodePlex today. This new version of ASP.NET MVC includes support for error handling, authorization, caching, and Ajax.  You can download this release at: http://www.codeplex.com...
Filed under: ,
9
Comments

ASP.NET MVC Tip #20 – How to Unit Test Data Access by swalther

In this tip, I demonstrate how you can write unit tests for MVC controller actions that access a database. I show you how to create unit tests for your LINQ to SQL controller action code. Most ASP.NET MVC applications that I write contain a substantial...
Filed under: , ,
4
Comments

ASP.NET MVC Tip #19 – Use the nVelocity View Engine by swalther

In this tip, I demonstrate how you can use the nVelocity view engine, instead of the normal Web Forms view engine, when displaying views from an ASP.NET MVC application. By default, you build views for an ASP.NET MVC application by creating ASP.NET Web...
Filed under: , ,
6
Comments

ASP.NET MVC Tip #18 – Parameterize the HTTP Context by swalther

Context is the enemy of testability. In this tip, I demonstrate how you can eliminate, once and for all, the HTTP Context from an ASP.NET MVC application. A controller action that interacts only with the set of parameters passed to it is very easy to...
Filed under: , ,
3
Comments

ASP.NET MVC Tip #17 – How to Run an ASP.NET MVC Application by swalther

In this tip, I explain the different options for running an ASP.NET MVC application from Visual Studio 2008. I recommend that you run an ASP.NET MVC application directly from the ASP.NET Development Web Server. An ASP.NET MVC application works differently...
Filed under: , ,
3
Comments

ASP.NET MVC Tip #16 – Create ASP.NET MVC Macros by swalther

In this tip, I show you how you can create a Visual Studio 2008 macro that creates a new MVC controller, view folder, and controller unit test with a single command. Don’t get me wrong. I like the Visual Studio 2008 designer tools. I like dragging...
Filed under: , ,
More Posts Next page »