[RESOLVED]Can Asp.net mvc on visual Studio 2012 , creates mobile views (with .mobile.cshtml extension) that are based on jQuery mobile

Currently i want to create a new asp.net mvc4 web project inside Visual Studio 2012. but i have the following question about the current capabilities for creating mobile views.

For example if i right click on an action method , i will get a dialog to create a new view, and it will automatically create a View (with .cshtml) for me using some bootstrap classes to have a responsive design, but my question is if there is way to create
mobile specific views using the same approach . or if i want to create a mobile specific view that uses jquery mobile i need to do this from scratch, i mean asp.net mvc and visual studio only supports creating view that have .cshtml and not based on jQuery

Yah, just follow bootstrap’s mantra "mobile first"


i did not mean if asp.net mvc supports rendering mobile views , what i meant is if Razor can automatically generate views based on jQuery mobile. For example in asp.net mvc 5 & Visual studio 2013 will generate the views based on Bootstrap template for desktop
browser. but is there a way to generate views based on jQuery mobile (i mean automatic generation, by right click on the action method and create a new view, so the generate view will have .mobile.cshtml and will use the jquery mobile syntax ?)

I don’t think there is a mobile view scaffolding generator. You should manually create it. You can create a template and use it for all your mobile views.

I think although MVC4 uses Razor finally it’s rendering into a html file in the browser.So you can define your all css responsive classes with divs inside a layout file.You can find default layout files inside the Shared folder under the Views folder.By
right click you can create a new layout file as i said above with your Bootstrap or whatever responsive files.And finally when creating views you can define that created layout for the views.

Leave a Reply