views:

127

answers:

1

I just moved my application under a virtual path on my local iis 7.0 so that I can host multiple sites.. Routes are not working part from the main page

They seem to ignore the virtual path I created and going to the root - eg:

instead of http://localhost/virtualpath/product/5

goes to http://localhost/product/5

I seem to be missing something very fundamental?

routes.MapRoute(
            "Products",
            "Products",
            new { controller = "Product", action = "Index" }
        );



        routes.MapRoute(
            "ProductDetails",
            "Product/{id}/{name}",
            new { controller = "Product", action = "Details", id = -1, name = "" }
        );



        routes.MapRoute(
            "Default",
            "{controller}/{action}/{id}",
            new { controller = "Home", action = "Index", id = "" }
        );
A: 

OK I found out that I was making several referential mistakes in my linking and other references that all came out when I switched to virtual directory.

The above example was due to me generating the url on a client side js script and I was using / in the beginning..

kaivalya