隐藏在查询字符串MVC行动 [英] Hide Querystring in MVC action

查看:180
本文介绍了隐藏在查询字符串MVC行动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查询字符串躲进我的控制器的动作。

I want to hide the Querystring into My controller's action.

在我的应用程序scenariois是这样的:

In my application scenariois something like this:

1)
   我已经打开了新的行动进入新的窗口为:

1) I have opened new action into new Window as:

var check="Particular String"
var url = rootUrl("Home/Preview?Docs=" + check);
window.open(url, '_blank');

2)在控制器的侧面我已经使用了一些code到控制器的行动:

2) On controller's Side I have used some code into Controller's action as:

 public ActionResult Preview(string Docs)
        {
            TempData["Docs"] = Docs;
            return RedirectToAction("UnInvoicedPreview");
        }

我的查询:: 1)打开新的窗口时,它显示了在开始时查询字符串(uptill当它不重定向到另一个动作)。

My Query:: 1) when opening new window it shows the Query string in the Begining(uptill when it doesn't redirects to another action).

2)我不想显示,查询字符串到URL。

2) I dont want to show that QueryString into the URL.

3)有没有办法隐藏查询字符串或者我们可以加密?

3) Is there any way to hide the Query string or can we Encrypt that?

推荐答案

您可以试试这个:

HttpServerUtility.UrlTokenEn code HttpServerUtility.UrlTokenDe code 来的字节数组转换为URL -safe字符串

HttpServerUtility.UrlTokenEncode and HttpServerUtility.UrlTokenDecode to convert byte array to URL-safe string

这篇关于隐藏在查询字符串MVC行动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆