C# - How to Rewrite a URL in MVC3
问题 I have an URL like this: http://website.com/Profile/Member/34 I need this URL runs like this: http://website.com/Profile/John Given John as profile name for the user id=34. Can anyone give me directions to do that? 回答1: In global.asx you need to add a new route. public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute( "Member", // Route name "Profile/{member}", // URL with member new { controller = "YourController", action = "Profile"} ); } You will still need to implement