What is a friend URL? It is actually a friendly URL format. Let's call it like this.
In ASP. net mvc, URL is subject to route control, and you can rewrite the URL without any settings. This ensures that the URL is concise and clear!
In the ASP. NET project, we used to rewrite the page url, so we had to expand an httphandler with a big deal, and then matched it with a regular expression.
Rewriter is used to rewrite the URL!
Now let's try to build our own friend URL reasonably and quickly in ASP. NET!
Official reference: http://msdn.microsoft.com/zh-cn/library/cc668201.aspx
Based on what is officially provided, we isolate the content to be rewritten in the global. CS file and store it through the XML file.
1. Configure the node for the page where the URL needs to be rewritten in the site
Name indicates routename
To represents the rewritten address.
From physical path of the page before standard Rewriting
2. Rewrite the global. CS registerroutes function.
3. effect Preview
I hope you can give me more advice when writing blogs for the first time. Thank you !!