MVC Now Stands for Mobile Views ConqueredPosted: May 21, 2011
Say hello to my little friend. Always wanted to say that. But seriously, say hello to jQuery Mobile. It’s pretty obvious what its all about so I’ll get straight to it. Here’s a little look at how pages of ASP.Net MVC applications can be hosted to work with mobile devices et with amazing interfaces.
We’ll need to link the resources either from the CDN that’s mentioned on jQMobile’s download page. Or you can… download them. As I have.
Give it structure.
I gave this MVC3 project’s
_Layout.cshtml the following layout so that I can use it throughout my other views and modify those as required.
<div data-role="page"> <div data-role="header"> <h1>@ViewBag.Title</h1> </div> <div data-role="content">@RenderBody()</div> <div data-role="footer"> <h4>Footer here</h4> </div> </div>
data-role attribute, we can specify different parts of the page as we like. And as you might guess
From there on it’s just good old MVC with jQMobile doing all the neat work, preparing the application for mobile platforms.