1

我有一个索引操作:

[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 中不可能,如果不可能,那么在客户端处理它的简单方法?有人对此有任何想法吗?

4

1 回答 1

2

您可以使用 POST 请求而不是 GET。如果这是真的不应该看到的敏感信息(即使是确定的用户),那么这些信息与客户端无关。它应该安全地保存在服务器上。

于 2012-06-19T05:52:16.900 回答