Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

For security reasons, I want to pass some values from one ASP page to another one but NOT through the URL (using Querystring). How can I manage to do that?

Cheers,
Posted

Hi ,
Use session Google for it Google[^]
Best Regards
M.Mitwalli
 
Share this answer
 
Hi,

If you are using ASP.NET, then you can do it by Session Variable.

Suppose you have some value lik:
Myvalue

Assign it to Session Variable like


C#
Session["VariableName"]="MyValue";



and you can use this Session variable throughout the Web site.
 
Share this answer
 
Not through URL — is a right idea. The background problem is that HTTP is a stateless protocol. To work around this problem, Session State Management is used. Please start from the overview:
http://msdn.microsoft.com/en-us/library/ms178581.aspx[^].

For more general State Management Overview, please see:
http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx[^]

—SA
 
Share this answer
 
v2
You can use session, application, cache for it. to understand these things and contrast with other ways of doiing the same thing including query string please see this.

A Beginner's Tutorial on ASP.NET State Management[^]
 
Share this answer
 
Study below you will get good idea.
State Management in ASP.NET - Introduction[^]
 
Share this answer
 
use a class variable
store value in variable
and get it in another page.

Ex.

C#
class myClass()
{
public static string myVariable="";
}


On first page pass value in this variable as

C#
myClass.myVariable="something";


and on the other page get value from this variable as

C#
string temp=myClass.myVariable;
 
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