我一直在试图解决这个问题,但找不到任何问题的答案。我遇到的问题是这个网址:
localhost:343434/Lev/Details/1/4/CON/2
此 url 将返回“'/' 应用程序中的服务器错误”。我知道我的 Action 将返回一个带有这些参数的值。
但是,如果我使用相同的路线但使用其他参数:
localhost:343434/Lev/Details/3/4/FHS/5
它将调用操作并返回结果。“'/'应用程序中的服务器错误”仅在使用“CON”时出现
输出是这样的:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Lev/Details/1/4/CON/2
这是我的路线:
routes.MapRoute(
"LevRoute",
"{controller}/{action}/{id}/{source}/{levtyp}/{Levid2}/{page}/{order}",
new { controller = "Lev", action = "Details", page = UrlParameter.Optional, order = UrlParameter.Optional }
);
提前感谢您的帮助!