MVC 中用JS跳转窗体Window.Location.href
MVC 中用JS跳转窗体Window.Location.href
一般的Window.Location.href会造成URL地址追加
较为好的写法为:
return Content(string.Format("", Url.Action("OfflineLab", "OfflineLab", new { labType = Server.UrlEncode(topic), conditionDesc = unit })));
①要是有中文参数的话,需要加 Server.UrlEncode(中文参数)传递到控制器的action中;
②接收中文参数的话,则为 string labType = Server.UrlDecode(labType);