gpt4 book ai didi

asp.net-mvc - 当传递的参数包含点时,asp.net mvc 路由

转载 作者:行者123 更新时间:2023-12-04 08:30:51 24 4
gpt4 key购买 nike

我有非常基本的路由:

routes.MapRoute(
"Default",
"{controller}/{action}/{id}",parameters
new { controller = "Home", action = "Index", id = "" }
);

问题是它在所有简单的情况下都能完美运行,比如 www.xxx.yy/pages/filter/test “。一旦我将点“。”添加到 {id} 部分,它就会失败,
返回“找不到资源。”它发生在 www.xxx.yy/pages/filter/test.
有什么建议?

最佳答案

只需在 URL 末尾添加一个斜杠“/”:www.xxx.yy/pages/filter/test./
见:Dots in URL causes 404 with ASP.NET mvc and IIS .

关于asp.net-mvc - 当传递的参数包含点时,asp.net mvc 路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/431945/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com