ASP.Net MVC Framework Introduction

No.of Views690
Bookmarked0 times
Downloads 
Votes0
By  Dhananjay Kumar   On  16 Feb 2010 00:02:56
Tag : ASP.NET , How to
ASP.Net MVC Framework Introduction
emailbookmarkadd commentsprint

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

 

ASP.NET MVC framework Overview

Objective:

This tutorial will explain basically, how to work with ASP.NET MVC Frame work. I will explain that in chronic fashion. It would come in different parts.
Objective of PART 1:
Here I am going to introduce, what is MVC Design pattern. What are the advantages of using ASP.NET MVCF Framework?

MVC Pattern
The MVC pattern helps to create applications that separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements. The pattern specifies where each kind of logic should be located in the application. The separation helps to manage complexity.

As written at MSDN


The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:


Model: The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).


View: The view manages the display of information.


Controller: The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Structural relationship between the three objects.

Image Loading....

According to Martin Flower

Following this principle leads to several good results. First, this presentation code [View] separates the code into different areas of complexity. Any successful presentation requires a fair bit of programming, and the complexity inherent in that presentation differs in style from the domain [Model] with which you work. Often it uses libraries that are only relevant to that presentation. A clear separation lets you concentrate on each aspect of the problem separately—and one complicated thing at a time is enough. It also lets different people work on the separate pieces, which is useful when people want to hone more specialized skills.

So MVC components could be summarized as follows


Model: This component implements logic of the application data domain.


View: This component displays user interface. UI get created from Model data.


Controller: This component handles user interaction. It controls user input to display information on View from Model.

Image Loading...

Pictorially operations in MVC framework could be shown as

Image Loading....

ASP.NET MVC Frame Work

The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications.

The ASP.NET MVC framework offers the following advantages:


• It makes it easier to manage complexity by dividing an application into the model, the view, and the controller.
• It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.
• It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. F
• It provides better support for test-driven development (TDD).
• It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.

Features of ASP.NET MVC Framework


1. Separation of application task and testability and test driven development by default.
2. Any Unit test framework which is compatible with ASP.NET can be used for testing.
3. It is a pluggable framework. Any component can be easily replaced or designed or customized.
4. It supports uses of Dependency Injection and Inversion of Control Framework like UNITY.
5. It supports URL naming pattern that work well for Search Engine Optimization (SEO) and Representational state transfer (REST) addressing.
6. It supports existing ASP.NET features.
7. It supports of using markup in existing .ASPX pages.

How to Start with ASP.NET MVC Frame work?

Step 1:

If ASP.NET MVC Frame Work Project template is installed on machine then we could select it as
File-> New-> Project->Web-> ASP.NET MVC web Application. If Project template is not installed it download it from here

Image Loading....

Step 2:


Select as per requirement, whether to create Unit test project or not.

Image Loading....

Step 3:


After creating Solution explorer will contain following folders.

Image Loading....

Step 4:

Run this Sample project. Following page will get display in browser.

Image Loading....

This is a running ASP.NET MVC application.

URL and Page Mapping

Image Loading...

There is no one to one relationship between page and URL in ASP.NET MVC web application.

Image Loading....

Note: I will continue this article in next part. This is Part 1 and here I am explaining Introduction of MVC Design pattern and ASP.NET MVC Frame work. Happy Coding

Thank you


About the Author


Dhananjay Kumar
Description :I done my engineering from Anand Engineering college Agra in 2007. I am MCTS WCF, MCTS MOSS Development, I am MCTS Web Development . I am native of Jamshedpur. Currently Please feel free to contact me regarding any clarification of my article at Dhananjay.25july@gmail.com

Occupation : Software Engineer
Company : UST Global.
Location : India
Follow me at twitter : http://twitter.com/dhananjay25


 
Sign Up to vote for this article
 
About Author
 
Dhananjay Kumar
Occupation- Software Engineer
Company-Infosys Technolgies,Pune
Member Type-Gold
Location-India
Joined date-20 Jul 2009
Home Page-http://dhananjaykumar.net/
Blog Page-http://dhananjaykumar.net/
Dhananjay Kumar is Microsoft MVP on connected system. He blogs at http://dhananjaykumar.net/ . You can follow him http://twitter.com/debugmode_/ and reach him at dhananjay.25july@gmail.com
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top