views:

58

answers:

2

Currently we are using query-string extensively in our asp.net application. Few days back we were working on enhancing the website. In this we first of all decided not to show the complete url of the webpage on the address bar for this i asked this question regarding it on SO

The best way we got was to use server.transfer(). But now it seems that the query-string does not work with it! Is there a way around this so we may use query-strings and do not display the url of the webpage on the address bar. Please guide.

Thanks in advance.

A: 

why do you want to hide the query-sting? is there any information that is private, if thats the case the i would suggest to save it in a session instead.

Petoj
Lot of logic and code has been written with regard to query-string... changing it completely to session would be quite time consuming. We are exploring options that can be implemented ASAP.
HotTester
+1  A: 

Server.Transfer should pass through any existing querystring or form collections to the called handler.

The Transfer method preserves the QueryString and Form collections.

If you are calling Server.Transfer(path, preserveForm), ensure that you are setting the second parameter to true.

However as you've found, you can't set the path to a url with a querystrings when calling the Server.Transfer method.

Please also note the following potential issues with going down this route:

  1. ASP.NET does not validate that the user should have access to this resource - so if you are using standard authorisation mechanisms on your site, you won't be able to rely on them any more.
  2. Users won't be able to bookmark any page beyond the homepage on your site/send people links/deep link into your site.
  3. Search engines will have great difficulty indexing/serving results for your site, as all they will see is the one URL.
Zhaph - Ben Duguid
I'll check it and revert back ASAP.
HotTester