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.