ASP.NET MVC simple process explained

In the article notes where we have created a simple MVC program

In view of the, @ Model refers MyFirstMvc.Models.IndexModel, our submission page is / Test / Index, when after we enter the number and press the submit button, the program will go to the Index method in the controller class TestController and Model passed to it.

Note: name attribute value input tag and attribute names must IndexModel is consistent, the case can be inconsistent, but as consistent as possible.

In the controller, return Index Method (model) refers to the operation model object returned to the End Test / Index.cshtml page.

Model data transfer functions in the middle of both.

These classes, methods, and so is the default naming convention, named only way they can find each other, and to complete the process.

cshtml document is to simplify HTML template stitching, and ultimately generate html to the browser display, can not directly access cshtml

Guess you like

Origin www.cnblogs.com/1016391912pm/p/12089297.html