MVC4 – Mobile Application Template

This is my third post on Exploring MVC 4 Templates. & i will discuss“Mobile Application Template”

In Visual Studio 2010 . Create a new ASP.NET MVC4 Project.  Select “Mobile Application” from given list of Templates & click OK.

mvc_Mobile_Template

This should create a project for you with following defaults.

mvc4_Mobile_Defaults

We can see a two controller files added under Controllers Dir with a corresponding Views.

Also if we explore Scripts folder we can notice jquery Mobile library , that helps the content to dynamically fit for browsers on device.

mvc_Mobile_Scripts

Hit F5 & you should be able to see the application running.

We also need to see how will the page look like on actual device, Therefore we will launch Windows Phone 7 Emulator, & browse to our webpage url. (eg : http://localhost:62174/ )

You should be able to view the first page on your emulator.

MVC4 – Internet Application Template

This is my third post on Exploring MVC 4 Templates. & i will discuss“Internet Application Template”

In Visual Studio 2010 . Create a new ASP.NET MVC4 Project.  Select “Internet Application” from given list of Templates & click OK.

MVC4_InternetApplication

This should create a project for you with following defaults.

MVC4_InternetApplication_Defaults

We can see a HomeController.cs file added under Controllers with a corresponding Home View.

Hit F5 & you should be able to see the application running.

MVC4 – Basic Project Template

This is my second post on Exploring MVC 4 Templates. & i will discuss“Basic Project Template”

In Visual Studio 2010 . Create a new ASP.NET MVC4 Project.  Select “Basic” from given list of Templates & click OK.

BasicProjectTemplate

This should create a project for you with following defaults.

mvcBasicProject

A Basic MVC project has no files under Controllers, Views & Models. Comparing with “Empty” Project,  App_Start folder contains BundleConfig.cs file & there is a Scripts folder in the solution. Project disk size is less than 30 MB.

In order to make this template working, we will add a HomeController & a Index view like we did in this post.

MVC4 – Empty Project Template

This is my first post on Exploring MVC 4 Templates. & i will start with “Empty Project Template”

In Visual Studio 2010 . Create a new ASP.NET MVC4 Project.  Select “Empty” from given list of Templates & click OK.

EmptyProjectTemplate

This should create a project for you with following defaults.

EmptyProjectDefaults

An Empty MVC project provides the minimum set of resources & references to run MVC4 application. Notice that we have no files under Controllers, Views & Models. Project disk size is less than 12 MB.

Hit F5 key to run your application.

Get surprised to see an error page , telling that “The resource cannot be found.” This is because the ASP.Net engine expects a Controller & a View Object.

To make your project work, add a controller to your project.

AddController

Notice that we have selected “Empty MVC Controller” Template.

Now we need to add a View Object in our solution.

AddView

We will keep our View file under Home folder

SlnExplorer

Now if we hit F5, we should be able to see a page without any errors.