[英]How to route URLs like /controller/action-name to controller/action_name in ASP.NET MVC
I want my URLs use '-' but the C# method name cannot contains that character. 我希望我的URL使用“-”,但C#方法名称不能包含该字符。 How do I make this route?
我该怎么做?
You would need to define a new route handler which handles the hyphens before the controller and action elements are mapped to class and methods. 在将控制器和操作元素映射到类和方法之前,您需要定义一个新的路由处理程序来处理连字符。 Check out this StackOverflow question
看看这个StackOverflow问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.