Click here to Skip to main content
Click here to Skip to main content

Creating a Mobile Application Using MVC4

, 10 Aug 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
How to build a MVC4 Mobile application.


MVC is one of three ASP.NET programming models.

MVC is a framework for building web applications using an MVC (Model View Controller) design:

  • The Model represents the application core (for instance a list of database records).
  • The View displays the data (the database records).
  • The Controller handles the input (to the database records).

The MVC model also provides full control over HTML, CSS, and JavaScript.


  • Install Visual Studio 2010 (SP1)
  • Install ASP.NET MVC4
  • Install Microsoft SQL Server Compact 4.0
  • Install Opera Mobile Emulator

Getting Started

The following steps will show how to build a MVC4 Mobile application.

Step 1

Open Visual Studio, select New Project -> ASP.NET MVC4 Web Application.

Step 2

Select Mobile Application from the Project Template.

Step 3

Go to Solution Explorer, right-click on the App_Data folder, and click on Add New Item.

Select SQL Server Compact 4.0 Local Database and name it as Movies.sdf.

Step 4

Database is added to the App_Data folder.

Step 5

Create a table and name it MovieDBs.

Step 6

Add ConnectionString in Web.config.

Step 7

Right-click on Model->Add->Class and paste the following code:

Note: ConnectionString name and Class name should be the same.

Step 8

Right-click on Controller->Add->Controller Add Controller Window Popup.

Click on Add button and it will create a Movies Controller.

Step 9

Run application using Opera Mobile Emulator and it shows the following result.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Ravindra T C
Software Developer L&T IES Mysore
India India
I'm a software developer. I spent most of the time in learning new technologies. I've a keen interest in client-side technologies especially JavaScript and Jquery it is the most beautiful language ever seen.

I like sharing my knowledge and written some non-popular articles. I believe in quality and standards but blames myself for lagging them.

I believe in small things and they makes me happy!

Comments and Discussions

QuestionHow to Install the App in the Mobile PinmemberAnubhava Dimri16-Jul-14 2:23 
GeneralMy vote of 1 Pinmemberrubol22-Sep-13 20:05 
GeneralMy vote of 4 Pinmembertgueth26-Feb-13 11:53 
QuestionDEvelop mobile applications using mvc? PinmemberMember 917112810-Dec-12 19:21 
Question[My vote of 1] Poor Sample [modified] Pinmembermsdevtech29-Oct-12 17:28 
GeneralMy vote of 5 PinmemberNandakishorerao15-Aug-12 22:51 
Questionneed to know Pinmembercsharpbd10-Aug-12 14:34 
AnswerRe: need to know PinmemberRavindra T C10-Aug-12 17:32 
GeneralRe: need to know Pinmembercsharpbd11-Aug-12 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150326.1 | Last Updated 10 Aug 2012
Article Copyright 2012 by Ravindra T C
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid