How to create a sample ASP.Net MVC project / MVC Website????
First we need to istall Framework 3.5 with SP1 to create a MVC Project/Website.
What is MVC?,What is ASP.Net MVC Application?
MVC means Model, Views and controllers. what are these???????
Controllers - Resposnsible for controlling the user interactions. It takes the browser requests and the controller contains the logic, how to resposnse to browser requests. Controller may direct to a page or to another controller or to another class.
In short Controllers are the flow control logic in an application.
ASP.Net MVC View - It is all about the view in application, that is a view can be a HTML Page,Scripts for menu or in short in an ASP .net application what we see can call as a VIEW in MVC application. That is the logic behind the view. I think you folow me.
MOdel - All application logics such as businnes logic , validation logics, data access logic, data access class etc.
These are the basic steps to create a MVC Project
- Launch Visual Studio 2008, Select the menu option File, New Project then New Project Dialogue box appear as shown below
Select the ASP.NET MVC Web Application Template from the dialogue box and click Ok.
When you create a ASP.NET MVC Application, Create Unit Test Dialogue box appears as shown below.
Select the Yes, create a unit test project and click Ok.
After ASP.NET MVC Application is created. You will see several folders in Solution Explorer. You will find three folders named Models, Views and Controllers.
If you expand the Controllers Folder, you will see a file named HomeController.cs and if you expand the Views folder you will see About.aspx and Index.aspx under Home Sub Folder.
Now you run the application you will see the output
I think now it is more clear the idea MVC..right...??
The advantage of MVC are
- Provides complete control over your HTML markup
- Enables rich AJAX integration
Intuitive website URLs
Clear separation of concerns which results in web applications that are easier to maintain and extend over time.
Testability – including support for test-driven development.
Happy programming
Shijo JOseph

