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不希望看到的。
感謝您的幫助。