For the original article, see the original article ASP. net mvc source refresh preview of scottgu.
Here is just a summary.
Note:A few hours ago we published a refresh of the ASP. net mvc source code on the site. This source refresh Is notAn official new ASP. Net MVC preview release-instead it is an interim drop that provides a look at the current state of the source tree. (directly post the original text, that is, thisNoAn official pre-view version is only available for the moment. It is a preview of the current status of MVC preview 3)
The maproute () method is overloaded and can have two, three, and four parameters (route name, URL syntax, URL parameter default, and URL parameter Regular Expression constraints ). regular Expression, haha, this handsome guy.
Then we can refer to this "products-browse" rule to generate a URL for it in our controller and action. For example, we can use HTML. routelink view helper to generate a URL:
The generated URL is as follows: