This article will provide you a quick introduction to ASP.NET MVC 4 as well as an explanation of how ASP.NET MVC 4 fits into ASP.NET.
Some other major facets of this article are, what's new in ASP.NET MVC 4 and how to determine your development environment to build ASP.NET MVC 4 applications.
Introduction | ASP.NET MVC 4ASP.NET MVC is a fabric for building network applications that use the general and basic Model View Controller pattern for ASP.NET MVC. The ASP.NET framework is connected
in some aspects and depend on the functionality.
ASP.NET MVC in ASP.NETASP.NET came into the light in 2002. At that time it was easy to imagine both ASP.NET and Web Forms together as a single unit or we can say as the same thing. ASP.NET has always supported two layers of abstraction for supporting both the features and some other
too, these two layers of ASP.NET framework are as follows.
(I described them as Layer1 and Layer2, it does not mean they are in this specific order.)
System.Web.UIThis is a web form layer that is found in a namespace list. This layer consists of a wide-eyed, clean feel.
System.WebThis is the second stratum. This layer provides this set of functionalities:
Functionality
The mainstream method of developing ASP.NET MVC with ASP.NET are:
http://www.c-sharpcorner.com/UploadFile/2072a9/creating-a-sample-app-through-asp.net-mvc
MVC specifies options for how the project should be created.
Application Templates
There are several templates available in ASP.NET MVC 4 development work. These templates are as follows:
- The internet application template
- The intranet application template
- The basic template
- The empty template
- The mobile application template
- The web API template
The internet application template
This contains the beginning of an MVC web application, enough that you can run the application immediately after creating it and see a few pages. The template also includes some basic account management functions that run against the ASP.NET membership system depending on your development work.
The intranet application template
The intranet application template was added as part of the AS.NET MVC 3 tools update. It is similar to an internet application template. But the account management functions run against Windows accounts rather than the ASP.NET membership system.
The basic template
The template is pretty minimal. It still contains:
Running an application created using the empty template that gives you an error message.
The basic template is intended for experienced MVC developers who want to set up and configure how you want them to be.
The Empty Template
In the most general cases the basic Template is called the Empty Template, but developers have some issues regarding this matter. They complained that:
"It wasn't quite empty enough, with MVC 4, the previous empty template was renamed BASIC and the new Empty Template is about as empty as you can get."
The Mobile Application Template
The mobile application template is re-configured with jQuery mobile to jump-start creating a mobile only website. It includes these most important base structures or we can say the functionalities:
The Web API Template
The ASP.NET Web API is nothing but a framework for creating HTTP services. The web API template is similar to the internet application template.
Web API functionality is also available in the other MVC project templates and even in non-MVC project types.
Razor View Engine (RVE)
The Razor View Engine is one of the most popular and utilitarian features that existed in MVC 3. Further, it is developed for more advanced functionality in MVC 4.
The razor engine has been the first major update to rendering HTML since ASP.NET 1 shipped almost a decade ago. It was something new that developers were looking for, none at that time was familiar with the fact that this "Razor Engine, that is neither a new language nor a puppet or a framework" will be a trump card of MVC in developing network based applications.
The default view engine used in MVC 1 and MVC 2 for rendering functionality was commonly called the Web Forms View Engine, because it applies the same aspx/ascx/master files and syntax generally used in web courses.
It was planned to support editing controls in a graphical editor or any editor that can be utilized for delivering functionality.
Structure View | RVE
The structural position of a Razor engine is something like:
MVC Application Structure
When you create a new MVC application with Visual Studio, it automatically adds several files and directories to the project.
These directories are:
· /Controllers
It is the directory where you place your controller classes that handle the URL requests. When we expand the controller directory, it shows two sub controller directories:
- HomeController
- AccountController
· /Models
It is the directory where you place your classes that represent and manipulate data and business objects. It contains three sub-directories:
· /View
It is the directory where you place your UI template files that are responsible for rendering output, such as HTML.
· /Scripts
It is the directory where you place your JavaScript library files and scripts.
· /Images
It is the directory where you place your images being used in site.
· /Content
It is the directory where you place your CSS and other site content, other than scripts and images used.
· /Filters
It is the directory where you place your filter code. A Filter is an advanced feature of MVC. It is useful with MVC 4.
· /App_Data
It is the directory where you place your data files, on which you need to perform Read/Write operations.
· /App_Start
It is the directory where you place your configuration code for features like:
-------------------------------------------------------------------------------
For creating a sample MVC CRUD app, please visit this link:
I hope you will like this.