我有一个索引操作:
[HttpGet]
public ActionResult Index (bool Myparam, ...)
{
if(Myparam)
{
...
}
return View(model);
}
我Myparam
用来设置模型的一些值,但我希望用户看不到Myparam
. 在某些页面中,我知道返回索引页面后RedirectToAction
的路由值的 URL 是:Myparam=true
http://mysitemainurl.com/Collection/Index?Page=2&Myparam = true&RowCount=5
我需要显示的 URL 将是:
http://mysitemainurl.com/Collection/Index?Page=2&RowCount=5
我更喜欢在 Controller 中处理它,如果在 View 中不可能,如果不可能,那么在客户端处理它的简单方法?有人对此有任何想法吗?