Following on from this question:
I have a similar requirement where my end user doesn't want to see the controller name in the url for the landing or "home page" for their application.
I have a controller called DeviceController
which I want to be the "home page" controller. This controller has a number of actions and I'd like to use URL's like the following:
http://example.com -> calls Index() http://example.com/showdevice/1234 -> calls ShowDevice(int id) http://example.com/showhistory/1224 -> calls ShowHistory(int id)
I also need links generated for this controller to leave out the /device
part of the url.
I also have a number of other controllers, for example BuildController
:
http://example.com/build http://example.com/build/status/1234 http://example.com/build/restart/1234
and so on. The URL's for these controllers are fine as they are.
The problem is that I just can't seem to get my head around the routing for this even after studying the answers to the question referenced above.
Can someone provide a code sample explaining how to do this?
I'm using ASP.NET MVC2.