0

I know this is repeated question on Stack. But in my case the URL which I am using is passing the querystring details.

http://servername:82/root/ReportViewer.aspx?Id=/test/base/eg1 &Name=ReportDeatilName & User=783534

How can I hide the whole query string?

5
  • 2
    You could use URL rewriting... look for http://servername:82/root/ReportViewer.aspx?Id=/test/base/eg1 &Name=ReportDeatilName & User=783534 and redirect/sendto http://servername:82/root/ReportViewer.aspx?Id=/test/base/eg1 for example Commented Jun 13, 2012 at 12:46
  • Duane this URL is generated from NavigateUrl of MenuItem in asp.net in that case also will it work Commented Jun 13, 2012 at 12:51
  • I think it really doesn't matter, if you want to "hide it" send it via http post method (even that it's "against" the REST stuff if what you want is to "get" something from the server and not modified de resource...) using a js hidden form Commented Jun 13, 2012 at 12:54
  • @PratikGupta It doesn't matter, it will still work. Commented Jun 13, 2012 at 12:57
  • 1
    Here's a simple tutorial on how to do it. Commented Jun 13, 2012 at 13:05

3 Answers 3

3

If you can, instead of making a call with GET, you could generate the call using a POST.
So your url will look cleaner (eg: servername:82/root/ReportViewer.aspx), because all the infos are sent in the <form>.

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

2 Comments

I am not using any GET or POST by myself but using NavigateURL of MenuItems in Asp.net page
@PratikGupta - all hyperlinks are/make GET requests, whether or not they have query strings/vars is irrelevant (in the context of GET), by default (unless you do explicitly change the type of request, hyperlinks will be GET). The question seems repetitive because its likely no explanation as to why is provided. Indio's answer (use POST) is perfectly fine. So are server.transfer and URL Rewriting. All of these can be used in your case.
2

You can use Server.Transfer from your code behind.

This'd look that you're responsing from the same page. Similar to Response.Redirect but simply changes the "focus" on the Web server and transfers the request.

Server.Transfer("http://servername:82/root/ReportViewer.aspx?Id=/test/base/eg1 &Name=ReportDeatilName&User=783534");

1 Comment

Abdul i cant use this method as you can my response it's generated from NavigateUrl field
1

use Server.Transfer from your code behind

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.