Apr 29 2013

A View Engine for ASP.NET MVC Feature-Based Organized

Category: MVC | ASP.NETMatt @ 11:25

I am a huge fan of ASP.NET MVC.  It is leaps and bounds ahead of WebForms, and if you’re doing web development on the Microsoft platform, it’s arguably the best overall solution available.  But it is far from perfect.  One of the things that has bugged me about it since the very beginning is the default organization conventions, meaning separate folders for controllers, view models, and views.  These conventions can be replaced though.  Read on to see how.

More...

Tags: ,

Sep 15 2012

SpecsFor.Mvc 2.0 Released

Category: SpecsFor | MVCMatt @ 14:41

SpecsFor.Mvc 2.0 is out today.  This release includes drastically improved performance, support for Chrome, and support for the very latest versions of Selenium, ASP.NET MVC, and other libraries.

More...

Tags: , ,

May 19 2012

Using SpecsFor.Mvc - Establishing Context with Seed Data

Category: SpecsFor | Testing | ASP.NET | MVCMatt @ 16:11

SpecsFor.Mvc gives you a lot in a single NuGet package.  You get a test web host, a strongly-typed API for navigating around and interacting with your MVC app, and standard hooks for dealing with cross-cutting concerns like authentication, but you also get hooks that you can use to add your own behavior.  In this post, I’ll show you how to use one of those hooks to load seed data into your application to facilitate testing.

More...

Tags:

Apr 15 2012

Introducing MvcDisplayTemplates

Category: ASP.NET | MVC | SpecsForMatt @ 16:00

Beginning with version 2.0, ASP.NET MVC has shipped with a set of templates for both displaying and editing data.  These templates are buried within the System.Web.Mvc assembly.  While you can override them outright, you cannot easily extend them since they’re locked down.  The new MvcDisplayTemplates NuGet package fixes this problems.

More...

Tags:

Mar 30 2012

SpecsFor.Mvc 1.1 Released

Category: ASP.NET | MVC | Testing | SpecsForMatt @ 14:25

A new release of SpecsFor.Mvc is now live on NuGet.  This release includes one simple, but important, enhancement as well as a few other minor improvements.

More...

Tags:

Mar 8 2012

SpecsFor.Mvc 1.0 Released!

Category: SpecsFor | Testing | ASP.NET | MVCMatt @ 17:05

image

It’s late, so this will be a short post, but SpecsFor.Mvc version 1.0 has been released.  It took me a lot longer to wrap this up than I expected, but there are a lot more features in the 1.0 release than I had originally planned.  Overall, I’m very pleased with the end-user experience of the framework, though admittedly the internals of the project are in need of some cleanup and refactoring.  I have a lot of content planned that will highlight what SpecsFor.Mvc can do, but for now, this short video will have to do.  Be sure to watch the video in HD!  Enjoy!

Tags:

Mar 8 2012

ASP.NET MVC 3, Razor-C#, and VB.NET WebForms - ActionLink, RenderPartial, and RenderAction in WebForms

Category: ASP.NET | MVCMatt @ 15:55

Today I’m going to show you how to use MVC helper methods in your ASP.NET WebForms markup.  Why would you want to do this?  As I explained and demonstrated in the previous two posts in this series, I’m working on a project that has an extensive investment in WebForms (of the Visual Basic .NET variety), and a wholesale migration to MVC is just not possible.  With a little bit of black magic, I’ve shown you how to write C# MVC code and Razor views that can be consumed via a VB.NET WebForms app.  With this last “spell,” I’ll show you how you can start bringing that content into WebForms pages.

More...

Tags:

Mar 1 2012

ASP.NET MVC 3, Razor-C#, and VB.NET WebForms - Using Razor Views With WebForms Master Pages

Category: ASP.NET | MVCMatt @ 15:42

When we left off last time, I showed you how to write ASP.NET MVC code in C#, then consume and expose that functionality within a VB.NET WebForms project.  Why?  Because I’m maintaining a project with a huge investment in VB.NET WebForms, and a wholesale migration isn’t feasible.  This approach allows for a gradual migration from VB.NET WebForms to C# ASP.NET (with Razor!)  So far, all I’ve shown you how to do is render Razor views.  But what about all those existing VB.NET master pages?  Today I’ll show you how you can use these master pages as “layouts” for your Razor views.

More...

Tags:

Feb 15 2012

ASP.NET MVC 3, Razor-C#, and VB.NET WebForms - A Tale of Black Magic Voodoo

Category: ASP.NET | MVCMatt @ 15:45

What do you get when you mix a legacy VB.NET WebForms application, ASP.NET MVC, and Razor views that are written in C#?  If you said “Pain!” you are quite right.  But what you also get is the ability to leverage your existing investment in VB.NET WebForms while crafting new code in ASP.NET MVC Razory-C# goodness.  In this series of posts, I’m going to tell you how you, too, can concoct a wicked brew that will enable you to do crazy things, such as creating Razor views in C# that utilize VB.NET WebForms master pages, or how you can render MVC action methods from within WebForms markup.

More...

Tags:

Jul 7 2011

Cleaning up POSTs in ASP.NET MVC, the Fail Tracker Way

Category: Fail Tracker | MVC | ASP.NETMatt @ 12:36

Those who have worked with ASP.NET MVC for more than a day have no doubt found themselves repeating common patterns when handling POSTs.  Jimmy Bogard recently blogged one way to simplify your actions.  I handled the same problem in Fail Tracker by implementing a very simple convention (one-model-in, one-model-out) and pushing some responsibility into the application framework.  With this in place, cross-cutting POST handling logic can be pushed out of the action methods, and a common “doh” error (forgetting to perform server-side validation) can be eliminated.  Read on to find out how you can adopt this simple convention in your application framework. 

More...

Tags: