Home MVC Storefront

MVC Storefront, Part 11: Hooking Up The Shopping Cart And Components

In this episode I hook the site up to the shopping cart and run some tests on my Controllers. I also build a Component with a little-known feature of MVC, the System.Web.MVC.ComponentController.

Code Bath
This screencast is almost pure coding, and in some ways is the weakest one aside from the ComponentController stuff at the end. I felt it was important to show how I had to hook routing up to get the cart bits to work properly, but one thing I left out was the controller testing and mocking I did with Phil, which is coming up in the next screencast.

Errata
I've stopped adding the "Previously, On The MVC Storefront" section because it's getting too long. I've added the links to the side of my blog here.

 

Watch It Here

The Code Is Here.

Technorati Tags:
Ridge avatar
Ridge says:
Saturday, May 24, 2008

I want my super-wamadine!


JB avatar
JB says:
Saturday, May 24, 2008

What's the plan for components - will there be a ComponentActionResult type? will component views be ascx not aspx?

What is this about a 'sub controller'? I keep hearing the phrase but I don't know what that means.


Esico avatar
Esico says:
Saturday, May 24, 2008

well, in this scenario I would probably use a plain usercontrol and control it with public properties. However, I can imagine that you would use that component controller in a single component scenario (like a gridview).

Many thanks for all the movies!

Cheers

Ps

I think you made a copy and paste mistake in your html. You copy and past the outer div elements too which controls the position in your master. You prob did't wanted to do that. Just a design thing.


Jamie avatar
Jamie says:
Saturday, May 24, 2008

Will there be any easy way of packaging up components into their own assembly for re-use in other applications? I've played around with compiling regular view pages as resources inside an assembly with their controllers then registering a custom VirtualPathProvider to find those views, and though it worked it all seemed rather cumbersome. It'd be nice if that scenario was more baked in. I can see where certain components might be used in a number of applications and it would be nice to not have to just copy and paste into the component directory every time.


Miha Valencic avatar
Miha Valencic says:
Sunday, June 01, 2008

Rob,

with regards to what Jamie says, is there any documentation on "Compoenents" part of the MVC? The documentation on www.asp.net does not seem to mention it.

Also, with regards to components, Authentication/Authorization seem like a good candidates for that. Thinking about it makes me think how it all relates to django middleware. Is there a part of the MVC that relates to functionality like django's middleware "applications"?

Thanks,

Miha.



Search Me
Subscribe

Index Of MVC Screencasts

You can watch all of the MVC Screencasts up at ASP.NET, and even leave comments if you like.

Popular Posts
 
My Tweets
  • @haacked must.... resist... assimilation...
  • Dinner at the Haacks. How did Phil get such a cute kid? Evidently Phil's in the doghouse though...
  • @shanselman dude turn off twitter and drive! that's gotta be illegal!
  • For D'Arcy and Justice... Scottgu goes Canuck! http://twitpic.com/mfz1
  • Working in ScottGu's office with @shanselman. Wearing an Orange Polo and saying "go ahead" a lot for some reason.
  About Me



Hi! My name is Rob Conery and I work at Microsoft. I am the Creator of SubSonic and was the Chief Architect of the Commerce Starter Kit (a free, Open Source eCommerce platform for .NET)

I live in Kauai, HI with my family, and when my clients aren't looking, I sometimes write things on my blog (giving away secrets of incalculable value).