views:

69

answers:

2

We have multiple Asp.Net WebSites each running on IIS.

Site1 :  http://www.Site1.com/    
Site2 :  http://www.Site2.com/

We have to implement Shopping Cart functionality for each of the above WebSites. For each web site the corresponding shopping cart should work on the following Url.

Shopping Cart for Site1 :  http://www.Site1.com/shop/cart    
Shopping Cart for Site2 :  http://www.Site2.com/shop/cart

We want to develop the Shopping Cart application using Asp.Net MVC 2.0. But it should be reusable in both the above sites.

A: 

Hi Amitabh, Right now there is no mvc site I believe that does what you want, so it's difficult to point you to samples, but DotNetNuke does the same thing what you want, so you can take a look but it's in pure asp.net web forms, no mvc.

lakhlaniprashant.blogspot.com
A: 

I don't believe you can do it using the site url, but you can do it with an additional routing field. I do something similar for some blog software I wrote where I have www.sitename.com/targetBlog/Blog/Post. Where targetBlog can be games, software, personal or whatever. Blog is the controller, and post is the action. You just put it in your url, add it to your routes before the controller, and then you get it passed to your methods just like any other paramter.

Here is a route example

            routes.MapRoute(
            "BlogSpecific",                                              // Route name
            "{blogSubFolder}/{controller}/{action}",                           // URL with parameters
            new { blogSubFolder = "", controller = "", action = "" }  // Parameter defaults
        );
Arthur C