UPDATE – Reworded question
I am going to use JQuery Mobile for the mobile side of a new MVC applciation that I am building. Since JQuery Mobile will manage the different devices on the client side I need only one mobile view for each page that I create. This will simplify the number of views required and basically boil it down to mobile and desktop views, for now.
I would like to have one controller call 2 different views, with the caveat being the views are in different folders (mobile and desktop). For example, the Index method on the controller would call a build view path method
return View(BuildViewPath("Index"));
It works if my folders are like this but I hate to have to keep creating device subfolders for each controller view
Views
Login
Desktop
Index.aspx
Mobile
Index.aspx
For my login controller I would like the views would be structured as follows:
Views
Desktop
Login
Index.aspx
Mobile
Login
Index.aspx
I tried returning “~/Views/Desktop/Login/Index” but that did not work.I understand about the naming convention {controler}{view} so I can see why this isn’t right.
Is this possible or is it not a good idea? If not, what is the best practice for organizing a project for 2 different view paths. Remember, I am looking for one controller.
Thanks,
Paul
Here is the solution http://www.asp.net/learn/whitepapers/add-mobile-pages-to-your-aspnet-web-forms-mvc-application