ARTICLE

How to Create First MVC Application in ASP.NET

Posted by Megha Goyal Articles | ASP.NET MVC with C# July 14, 2012
In this application we will discuss how to start and create the MVC Application in ASP.NET.
Reader Level:

To create the MVC Application we have to follow various steps. MVC stands for Model View Controller and this is one of the most important development models of ASP.NET. In this the Model represents the business layer of the application which means it handles the logic for the application data and it also retrieves data from the database.

The View represents the display layer of the application which means it handles the display (view) of the data.

The Controller represents the input control which means it handles the input given to the database records. The MVC simplifies the complex applications in the sense that we can emphasize only one aspect at a time.

Here are some steps to create the simple MVC Application in ASP.NET:

Step 1:
First start the Visual Studio:

Image1.jpg

Step 2: Then click on file menu and select the project option from it:

Image2.jpg

Step 3: Then select the Web Templates and select the ASP.NET MVC3 Web Appliaction template:

Image3.jpg

Step 4: Here we will get another dialog box and we will select the Empty project template:

Image4.jpg

Step 5: Now, we need to add a controller to the application and to do that right-click the Controllers folder in the Visual Studio Solution Explorer window and select Add and then select the controller option from the pop up menu.

Image5.jpg

We need to add the controller to provide handlers to the application which will handle the incoming request.

Step 6: Now an Add controller dialog will appear and set the name to HelloController, select add button and it will create a controller class:

Image6.jpg

Step 7: Now, modify the HelloController Class as follows:

Image7.jpg
The Controller is like the class which contains a public method called the action method which can be invoked from the Web via URL to perform an action. 

Login to add your contents and source code to this article
post comment
     

Good article for beginners to create MVC application.

Posted by Jitendra Patel Sep 08, 2012

Good article to start for beginners.

Posted by Atul Kumar Jul 30, 2012

@prabhakar i have written the basic application of MVC.If you want to know that how to add the class library or any other thing about this application then you can prefer internet.

Posted by Megha Goyal Jul 18, 2012

In above article Its not enough for create MVC application. Please describe how to work with MVC and how to add class library in application.

Posted by Prabhakar Maurya Jul 16, 2012
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter