The virtue of the ASP.Net MVC framework
• allows you to fully control the formation of a response to the user and create a clean HTML code of a small size;
• The best divides the presentation layer and the level of business logic;
• allows you to perform unit testing and use the Test Driven Development (TDD) approach;
• Supports various view systems (View Engines);
Disadvantages of the ASP.Net MVC framework
• It is not event-based, so it can be quite difficult for developers to master, they are used to thinking in the style of Widows-forms and Web Forms;
• It takes more time to start productive work and more time to learn new things in web development.
Explanation The ASP.Nct MVC frame will be executed using the example of a very simple MVC bookstore application . It will allow you to view the list of books and place an order for their purchase. For the convenience of explaining the ASP.Net framework, first consider creating Models, then Controllers and finally Views.
Creating MVC Web Application Projects
To create an ASP.Net MVC project, use the Microsoft Visual Studio integrated development environment to run the command: File => NewProject => ASP.NET MVC 4 WebApplication (or the older version of the MVC framework). As a result of this command, the dialog box shown in Fig. 4.25.
Fig. 4.25. Dialog box for selecting the project template for the ICC application
When using the Empty template, an empty project is created, which does not include any classes; The Basic template also creates an empty project, but it includes a simple master page and a CSS file; The Inertnet Application template creates a project with classes that support forms-based authentication; and the Intranet Application template creates a project with classes that support Windows authentication.
Fig. 4.26. Structure of the project MWS in Solution Explorer when using the Basic template
MVC Project Folder Structure
Storing descriptions of Controllers that respond to browser requests
Storing descriptions for Views that contain user interface templates
Storing classes related to the model that perform the data processing.
Storage of additional files: images, CSS, etc.
Storage of all necessary files and resources, for example, databases used by the application
In this dialog box, you can also select the visualization tool. ASP.Net has built in two rendering systems, ASPX and Razor, which perform the transformation of the presentation template into HTML code (in more detail in Section 4.2.4).
After clicking OK, Visual Studio will create the project framework according to the selected template. For example, if you select a Basic template, you will create a project with the folder structure shown in Fig. 4.26.
The names of project folders, class names, and their placement are in accordance with the MVC's agreement on project configuration. For example, in accordance with this agreement: the project includes the folders described in Table. 4.10.
Compliance with the project configuration agreement reduces the number of required code and makes it easier for other developers to understand the code of the created project. The details of this agreement will be explained in the course of the description of the ASP.Net MVC framework.
In order to develop the MVC application example, you need to create a project using the Basic template and name it Bookstore.
Also We Can Offer!
- Argumentative essay
- Best college essays
- Buy custom essays online
- Buy essay online
- Cheap essay
- Cheap essay writing service
- Cheap writing service
- College essay
- College essay introduction
- College essay writing service
- Compare and contrast essay
- Custom essay
- Custom essay writing service
- Custom essays writing services
- Death penalty essay
- Do my essay
- Essay about love
- Essay about yourself
- Essay help
- Essay writing help
- Essay writing service reviews
- Essays online
- Fast food essay
- George orwell essays
- Human rights essay
- Narrative essay
- Pay to write essay
- Personal essay for college
- Personal narrative essay
- Persuasive writing
- Write my essay
- Write my essay for me cheap
- Writing a scholarship essay