ASP.NET MVC 4.0 Mobile Template

The five years back, we all are knew that we able to developed ASP.NET mobile application usign Visual Studio, but microsoft has been take off those templates from the visual studio in the following versions. But again there is a good news for all that Microsoft has released the much awaited ASP.NET MVC 4.0 developer preview and there are lots of features bundle with it. One of the greatest features is a mobile website.

Images in this article missing? We recently lost them in a site migration. We're
working to restore these as you read this. Should you need an image in an emergency,
please contact us at info@codegain.com

Introduction

The five years back, we all are knew that we able to developed ASP.NET mobile application usign Visual Studio, but microsoft has been take off those templates from the visual studio in the following versions. But again there is a good news for all that Microsoft has released the much awaited ASP.NET MVC 4.0 developer preview and there are lots of features bundle with it. One of the greatest features is a mobile website. Yes, Now with ASP.NET MVC 4.0 you can create mobile site also. So let’s create a simple application and let’s see how it works.To create mobile site first you need to click File->New Project->ASP.NET MVC 4.0 Web application. Like following.

Now once you click OK it will open a new another dialog like following where we have to choose the Mobile site.

As you can see in above post I have selected Razor view Once you click it will create a new application like following. As you can see similar structure as normal MVC Application application below.

This view are based on the standard jQuery Mobile. So this can be viewed in any tablet or mobile device. So if you have IPad and IPhone both then it will work on both. You need not to different application for both. see the browser first I have selected standard IPad size of browser.

Now lets see how it look in mobile. So I have made my browser same site as mobile. As you can see its working in both.

If you see the code of view you can see the razor syntax over there. Nothing change in razor syntax. But as you can see in below code you need to use Jquery mobile attributes like data-Role and other stuff which will convert standard HTML into mobile or device compatible website.

I am jalpesh vadgamaa an Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having experience of five year in Microsoft .NET Technology.I am working as Project Leader in Mid Size company.My work area comprises of Enterprise Level projects using ASP.NET and other Microsoft .NET Technologies.Please feel free to contact me for any queries via posting comments on my blog I will try to reply as early as possible.

In this article, we will look into 5 basic steps which will help us to run our first Azure program. In this article, we will understand how to create a simple web role application and while doing the same, we will understand some development concepts of Azure.