MVC series Learning (10)-generating URLs and forms, mvcurl

Source: Internet
Author: User

MVC series Learning (10)-generating URLs and forms, mvcurl

In this study, there are two routing rules in the route configuration information. When the website is started for the first time, two route tables are registered.

1. dynamically generate a url

A. in the routing rule, because Default is in front of the route table, the route table is recently found. no matter whether the Controller name you have defined is the same as the Default controller name in the route configuration information, in the browser, all are displayed. If the route table is available, the home is the Controller index and the Action method is used.

A1. same as above

B1. when a url is dynamically generated, only/

B1. although the Controller name is the same as the default value, the Action value is different from the default value, so the complete path is displayed.

C1. specify the route table used. The controller and view are the same as the default value. Therefore, you can omit

C2. specify the route table used. The request name is different from the default value, so the complete path is displayed.

D1. a distributed view is requested.

D2. generate a hyperlink. You can add custom attributes, but multiple request parameters are added.

D3. no multiple parameters

D4. if no controller name is specified, the controller with the same name as the controller of the view is called.

2. Generate a form

Method 1 (recommended ):

Method 2:

2.

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.