Stephen Walther on ASP.NET MVC
-
ASP.NET MVC Tip #34 – Dispose of Your DataContext (or Don’t)
In this tip, I demonstrate how you can dispose of a DataContext within an ASP.NET MVC controller. Next, I argue that there is no compelling reason to do this.
-
ASP.NET MVC Tip #33 – Unit Test LINQ to SQL
In this tip, I demonstrate how to unit test the LINQ to SQL DataContext object by creating a Fake DataContext. You can perform standard LINQ to SQL inserts, updates, deletes and LINQ queries against the Fake DataContext.
-
ASP.NET MVC Application Building #2: Family Video Website – Add the Database
In this series of blog entries, I build an entire ASP.NET MVC application from start to finish. I create a Family Video Website that you can use to host home videos and photographs.
-
ASP.NET MVC Tip #32 – Repopulate Form Fields with ViewData.Eval()
When you need to repopulate the form data in an edit form, displaying both valid and invalid values, use ViewData.Eval() to retrieve the values from both the view data dictionary and the view data Model.
-
ASP.NET MVC Tip #31 – Passing Data to Master Pages and User Controls
In this tip, I discuss four strategies for passing data to Master Pages and User Controls. I explain how you can pass data by using a code-behind class, by using an action filter, by using method calls, and by using abstract controller base classes. I recommend the final strategy.
-
ASP.NET MVC Tip #30 – Create Custom Route Constraints
In this tip, I show how you can create custom route constraints that prevent you from accessing a URL unless you are local and authenticated. I show you how you can create a LocalConstraint and an AuthenticatedConstraint. I also demonstrate how you can test your custom constraints.
-
ASP.NET MVC Tip #29 – Build a Controller to Debug Your Custom Routes
In this tip, I demonstrate how you can create a special controller that you can use to test your custom routes. I also explain how you can give your routes back their names so you can more effectively unit test your routes.
-
ASP.NET MVC Application Building #1: Family Video Website – Upload the Videos
In this series of blog entries, I build an entire ASP.NET MVC application from start to finish. I create a Family Video Website that you can use to host home videos and photographs.
-
ASP.NET MVC Tip #28 – Test If Caching Is Enabled
In this tip, I demonstrate how you can test if the OutputCache attribute is present on a controller action. I also demonstrate how you can test if the OutputCache attribute is set with a particular duration.
-
ASP.NET MVC Tip #27 – Create ASP.NET MVC Specific Visual Studio Add-Ins
In this tip, I discuss Eric Hexter’s TDD Class Generator Add-In for Visual Studio. This Add-In enables you to generate a class, an interface, and a test class by entering a single keyboard shortcut.