Redirecting to a page hiding query string parameters asp.net

rahulsen002 picture rahulsen002 · Mar 4, 2014 · Viewed 9.7k times · Source

I am working for a project which has web garden scenario and cannot keep any data in session/inmemory. The asp.net page opens from Appian(bpm tool) and we pass id through query string. Now, client is asking me to hide the query string parameter after reading it. But, in that case say, landing page is http://a.aspx?id='123' and after reading that value we have to redirect to b.aspx without exposing the id(query string). Please suggest me a suitable way to achieve this. I am not really getting any idea for this.

Answer

T McKeown picture T McKeown · Mar 4, 2014

you can add key/value pairs to the header, it won't be visible in the querystring.

HttpContext.Current.Response.Headers.Add( key, value);

and

string headerVal = HttpContext.Current.Request.Headers[key];