I have an application that has an open "end user" mode and a "back office" mode. Both โmodesโ pretty much share the same controller logic, but the user interfaces for these different โmodesโ are radically different.
Using the default outbound routing that you get when you create the project for the first time, I have something like the following:
Controllers \
HomeController.cs
Views
Backoffice
Index.aspx
Public
Index.aspx
Shared
BackOfficeSite.Master
PublicSite.Master
In my HomeController.cs , I have a logic that looks like this:
public ActionResult Index() { var devices = DeviceRepository.FindDevicesByCustomer(100); if(IsBackOffice()) { return View(@"~/Views/BackOffice/Index.aspx", devices); } return View(@"~/Views/Public/Index.aspx", devices); }
Is this the right way to do this, or am I digging myself as a punch?
I am using ASP.NET MVC 2.
source share