Subscribe to this Blog

Subscribe to this Blog

Stephen Walther on ASP.NET MVC

Recent Posts

2
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: ,
8
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: , ,
3
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: , ,
5
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: , ,
9
Comments

ASP.NET MVC Tip #15 – Pass Browser Cookies and Server Variables as Action Parameters by swalther

In this tip, I demonstrate how you can pass browser cookies and HTTP server variables to controller action methods in the same way as you can pass form and query string parameters. Imagine that you make the following browser request against an ASP.NET...
Filed under: , ,
8
Comments

ASP.NET MVC Tip #14 – Create a Template Helper Method by swalther

In this tip, you learn how to create and use templates in the MVC framework that you can use to display database data. I show you how to create a new MVC Helper method named the RenderTemplate() method. While I was back home in California during the 4...
Filed under: , ,
3
Comments

ASP.NET MVC Tip #13 – Unit Test Your Custom Routes by swalther

In this tip, I demonstrate how you can create unit tests for the routes in your ASP.NET MVC applications. I show how to test whether a URL is being mapped to the right controller, controller action, and action parameters. If you are being virtuous about...
Filed under: , , ,
11
Comments

ASP.NET MVC Tip #12 – Faking the Controller Context by swalther

In this tip, I show you how to test ASP.NET intrinsics when building unit tests for an ASP.NET MVC application. I show you how to create a standard set of fake objects that enables you to fake the current user, the current user roles, the request parameters...
Filed under: , , ,
More Posts Next page »