3

I want to hide the Querystring which is displayed into my URL as shown below in Image::

enter image description here

I am opening it into New Window as::

1) Jquery Code to Oepn New Window:

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

And 2) Controller(Server side) code :

    public class TestViewModel
    {
        public string Docs { get; set; }
        public long DocIDs { get; set; }
        public long TestIDs { get; set; }
    }
    public ActionResult Test(TestViewModel Test)
    {
        return View();
    }

But in this case the Document IDs displayed into the Querystring. I just want to hide the Querystring for more security. How can I do this?

3
  • Follow this link : stackoverflow.com/questions/3951768/… Commented Jan 29, 2014 at 5:04
  • You are asking the wrong question. Whether or not someone can see the document id should not matter to the security of your web app. If you are relying on hiding a variable to secure your application, you are doing it wrong. See stackoverflow.com/a/245586/130387 for more information Commented Jan 29, 2014 at 5:08
  • @BappiDatta But as shown above in the URL I am posting List of Documents maybe more. then in that case I need to hide those IDs. Commented Jan 29, 2014 at 5:55

3 Answers 3

1

You can do a post request instead. If you want it to be encrypted you should send it over https

Sign up to request clarification or add additional context in comments.

Comments

0
  1. You can store data in session variables or try storing values in cookies.

  2. It would be better to use TempData, which only allows the value to be used once (removed on first access). However, this implies the value will be used almost immediately.

  3. encrypt the querystring.

Comments

0

If you don't want to show the parameters, then don't send them store them in hidden fields in your main page, then on the opened window (TEST) get the values with JavaScript with window.opener.document.getElementById('ID_OF_THE_HIDDEN_ELEMENT_IN_THE_PARENT_PAGE').

Look at this example I wrote for another answer.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.