4. What is the function of the view function?
Creating a ViewResult object will be rendered as a view to give feedback to the user
- ViewResult created the Viewpageactivator object
- ViewResult selected the correct viewengine and will pass the parameters of the Viewpageactivator object to the Viewengine constructor.
- Viewengine creating an object of the view class
- Viewengine calls the view's Renderview method.
5. What is the relationship between ActionResult and Viewresult?
ActionResult is abstract class, and Viewresult is ActionResult's multilevel child node, multilevel is because Viewresult is a subclass of Viewresultbase, And Viewresultbase is the child node of ActionResult.
6. What is Contentresult?
Viewresult is an HTML response and Contentresult is a standard text response, returning only the string type. The difference is that Contentresult is a subclass of ActionResult.
After studying the basic knowledge of MVC in this section, we believe that we have a basic understanding of MVC. When you are developing ASP. NET MVC, you can also use some development tools. componentone Studio ASP . NET MVC is a lightweight control that integrates seamlessly with visual Studio and is fully compatible with MVC6 and ASP. NET 5.0, which greatly increases productivity.
in the next section, we will discuss models, validations, jquery, and JSON. So keep your eye on it! ComponentOne studio!
Original link: Http://www.codeproject.com/Articles/866143/Learn-MVC-step-by-step-in-days-Day
Related reading:
What makes C # the most worthwhile programming language to learn
See Microsoft's 20 Technology changes from Visual Studio
13 Things A C # developer should know
Visual Studio 2017 official release full record
Seven days learn ASP. NET mvc--in-depth understanding of ASP.