Asp.net mvc ActionLink向rout引擎发送get参数
让我们假设我有以下观点Asp.net mvc ActionLink向rout引擎发送get参数,asp.net-mvc,Asp.net Mvc,让我们假设我有以下观点 Html.ActionLink("ping", "X","Y"); 在路线课上 routes.MapRoute( name: "X", url: "{controller}/{action}/OId/{o_id}", defaults: new { controller = "Home", action = "Index" } ); routes.MapRoute( name: "Default", url: "{controll
Html.ActionLink("ping", "X","Y");
在路线课上
routes.MapRoute(
name: "X",
url: "{controller}/{action}/OId/{o_id}",
defaults: new { controller = "Home", action = "Index" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
当我在这个页面X/Z
时,操作链接的输出是
/X/Y
这是正确的,但如果请求GET Params包含一个名为o_id的变量,则输出为
/x/y/OId/*
虽然我没有向ActionLink方法发送任何参数?可能是重复的,那么问题是什么?Mr.@msmucker0527我只是不希望action链接获取我没有发送的任何参数。