Create an MVC application
Go to visual studio.net
Click on file
Click on new
Click on project
Select visual c# from the installed template.
Select ASP.net WVC web application template
Type the application name (example)
Select the location to save
Click on ok.
This will create an ASP.net MVC2 web application.
When we create ASP.net MVC2 web application it will create 5 folders.
- Content
- Controllers
- Models
- Views
- Scripts
Content folder:
This folder will contain all the required CSS files that is to be attached to the view pages.
These core tutorials will help you to learn the fundamentals of .NET. For an in-depth understanding and practical experience, explore Online ".NET Training"
Views folder:
By default, the views folder will contain 3 folders as follows
- Account
- Home
- Shared
Then every folder contains some view page.
The shared folder contains commonly used files like master pages, user control, etc.
Here we find only .aspx pages we do not find .cs files
.cs files will be available in the controller’s folders and models folder.
Controllers folder:
This folder will contain one .cs file for every folder available in views.
In view, we have a home folder and account folder so we find two supported files in controller folders.
- Account controller folder.cs
- Home controller.cs
Every controller file will contain some method called action method with the name of the webpage.
I.e. home controller.cs we find 4 action methods
Change password ()
Change password success ()
Logon ()
Register ()
Models folder:
This folder will contain one super file one each folder available in views
In case the view contains the data from the database
Scripts folder:
It will contain all javascript and journey files that contain the code related to validation.
For an in-depth understanding, of.NET click on
- ASP. NET web applications and ASP. NET MVC Application.
- Object initialization
- Razor syntax
- Collection Initialize ASP.net
- View engine & Razor view engine