0
我有一个@ url.Action,其中我将一个参数传递给动作。忽略具有特定参数的路线
当参数为null时,我想只是不做任何事,并保持在同一页面上。
我所做的是:不执行
routes.MapRoute(
null,
"Test/View/{Id}",
new { controller = "Test", action = "View" },
new { Id = @"\d+" } //id must be numerical
);
routes.IgnoreRoute("Test/View/{*pathInfo}");
的行动,但我的问题是,我得到这个:
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: /Test/View
对此我obvisouly不希望看到的。
感谢您的帮助。