Had we started our app using the Mobile Application template, we would have the jQuery Mobile library available to us immediately. Since we started our app using the Internet Application template, we need to add the library to our project. We will install it from a NuGet package using the Package Manager Console.
The jQuery Mobile NuGet package contains a file named _Layout.Mobile.cshtml
, the same name as the mobile layout we created in the prior chapter. For us to install the package properly, we need first to delete the _Layout.Mobile.cshtml
file from our existing project. It will be replaced with the one in the package. Right-click on the _Layout.Mobile.cshtml
file in our project and delete it. While removing layouts, go ahead and remove the Nexus 7 layout as well. We want all mobile devices to target the jQuery Mobile layouts.
Now we can open the Package Manager Console by selecting Library Package Manager from the Tools menu and install the jQuery Mobile MVC package...