我有一个简单的表格,有四个输入.当我提交表单时,我想使用GET http方法.
例如:
aaa : foo
bbb : ____
ccc : bar
ddd : ____
Run Code Online (Sandbox Code Playgroud)
我想要这个查询字符串:
/?aaa=foo&ccc=bar
Run Code Online (Sandbox Code Playgroud)
问题是我有这个查询字符串:
/?aaa=foo&bbb=&ccc=bar&ddd=
Run Code Online (Sandbox Code Playgroud)
如何从查询字符串中的表单中删除空字段?
谢谢.
我有以下路线:
routes.MapRoute("Event Overview", "{city}/{type}/{id}",
new {city="LA", controller = "BaseEvent", action = "EventOverview"}, new {city = new CityConstraint()});
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
Run Code Online (Sandbox Code Playgroud)
而且,我网站上的几个链接:
@Html.ActionLink("Make", "EventOverview", "BaseEvent", new { id = eventInfo.Key.OID, type = eventInfo.Key.XPObjectType.TypeName.GetShortTypeName(), activeTab = "#scheduleLink", session = eventInfo.Key.EventSchedules[0].SessionId, hall = eventInfo.Key.EventSchedules[0].HallId, client = eventInfo.Key.EventSchedules[0].BasePlace.PremieraClientId}, null)
@Html.ActionLink("Make", "EventOverview", "BaseEvent", new { id = eventInfo.Key.OID, type = eventInfo.Key.XPObjectType.TypeName.GetShortTypeName(), activeTab …
Run Code Online (Sandbox Code Playgroud)