I'm developing mobile web application. I need to get current displaymode is mobile in controller.
My problem is: I have 2 partialview
/Views/Shared/ListItem.cshtml
/Views/Shared/ListItem.mobile.cshtml
when use PartialView("ListItem") this is correctly works. But i need to put partialviews in sub folder
/Views/Shared/Modules/Post/ListItem.cshtml
/Views/Shared/Modules/Post/ListItem.mobile.cshtml
When i use PartialView("~/Views/Shared/Modules/Post/ListItem.cshtml") this works on desktop. when displaymode is mobile, ListItem.mobile.cshtml
not displayed.
My choice is
if( CurrentDisplayMode==Mobile){
PartialView("~/Views/Shared/Modules/Post/ListItem.mobile.cshtml");
else
PartialView("~/Views/Shared/Modules/Post/ListItem.cshtml");
How to get CurrentDisplayMode
?
How to solve this problem?