Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to hide values by using response.redirect()

response.redirect("xxx.aspx"?id=100);

in url id=100 is visible., how to hide this?
Posted
Comments
[no name] 23-Jun-12 7:55am    
why are you using ID over here..
You can easily redirect, if you right only this Response.Redirect("xxx.aspx");

If you are not satisfied with this then pls let me know

You are sending values to another page using querystring and query strings are visible in URL. if you want to not how the value then

1. use some other way of state management. refer this to know how that can be done.[^]
2. encrypt the value on the sending page and decrypt on recieving page. it will still be visible but less understadable.
 
Share this answer
 
Comments
Sk. Tajbir 24-Jun-12 5:46am    
Nice. +5
If you need to send ID to next page without using query string, then try to add it to the Session

C#
Session["ID"] = "idValue";

response.redirect("second.aspx");


in your next page

C#
if (Session["ID"] != null)
   var id = (string)Session["ID"];
 
Share this answer
 
v2
Comments
Umapathi K 23-Jun-12 8:16am    
i tried this 2.,
but actuall my need is.,

if(id=="idvalue")
{
response.redirect("xxx.aspx")
}
else
{
respose.redirect("yyy.aspx")
}

in this calse if id is not match with idvalue its redirecting into xxx.aspx page.,.,,







Umapathi
9942676484
So, what you are asking is that you want to show a different page without URL redirection....

In ASP.NET it is usually achieved by using partial views, so either a partial view or the main layout itself initiates a request, and replaces the partial view using AJAX, which leaves the current URL intact.

If you absolutely must open a different page but cannot display its URL parameters, then as was already recommended, use the session, is the simplest way.
 
Share this answer
 
v2
Hi,
There are many ways to pass the data from one page to another page if required. Forget about query strings and follow the links to get more information on it:
http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx[^]
Transferring page values to another page[^]
http://www.aspspider.com/qa/Question2607.aspx[^]

All the best.
--AK
 
Share this answer
 
HI
TO USE THE REWRITE URL to hide values by using response.redirect()
TRY THIS
 
Share this answer
 
encrypt the querystring is better way
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900