Basic knowledge of C#MVC

Source: Internet
Author: User

First, what is MVV?

A Web application that the browser requests to it is a method that returns the return value of the method to the browser.

The return value can be a string, or it can be a view.

Example : Browser request

Application has a method

 Public string Welcome (stringint1) {return"" " "+ Numtimes;}  

Enter the following in the browser to request the method:

/helloworld/welcome?name=scott&numtimes=4

Principle: Here The browser makes the request, just like the process of invoking a function in the original console. Can have parameters passed in.

Second, how does MVC explain the browser's request?

The application's routing configuration file specifies how the browser's request is interpreted

URL: "{controller}/{action}/{id}"

Third, view file (Razor)

Typically, you will not have the controller return HTML directly,
Because this code can become very cumbersome. Instead, we typically use a separate view template file to help
Generates the returned HTML.
The Razor view template file uses the. cshtml file name extension and provides an excellent
Elegant way to use the C # language to create the HTML you want to output.

Basic knowledge of C#MVC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.