Click here to Skip to main content
15,888,160 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am new to asp.net.I want to post data from one page to another page,like from page1.aspx to page2.aspx.Currently i am sending this by using query string.But due to some security issues i removed it.So any body tell me what is the best solution to send data without using query string.

Thanks in advance
Posted

Looks like you want to transfer some large data. Use DataTable or HashTable to store the data.

Page 1
Store the DataTable in Session
C#
Session["dtData"] = dtUserData;

Page 2
Get the data from session
C#
DataTable dtTemp = (DataTable)Session["dtData"];

That's all.
 
Share this answer
 
Comments
[no name] 28-Dec-11 6:22am    
this is fine for you getting value from database.
thatraja 28-Dec-11 6:27am    
You can build datatable in your codebehind without using database.
See this Clickety
Espen Harlinn 28-Dec-11 10:51am    
My 5 - anything can be plugged into a session variable :)
Wendelius 28-Dec-11 15:25pm    
Very nice, 5
check this link for various ways of transferring data between pages in asp.net.

transferring data between pages[^]
 
Share this answer
 
Comments
sunny dhiman 28-Dec-11 5:37am    
Thanks for your reply.Currently i am using session but can we make full application with the help of sessions ?
karthi18988 28-Dec-11 8:43am    
yes and use viewstate method
there is lots of thing is there
1) Session
2) QueryString
3) Cookies


for this you read sate managment in asp.net

http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx

check this link then u get idea about that.
 
Share this answer
 
Comments
sunny dhiman 28-Dec-11 5:37am    
Thanks for your reply.Currently i am using session but can we make full application with the help of sessions ?
[no name] 28-Dec-11 6:20am    
u can acess that session vriable in full application
upto your session is not time out!
use session variables..

session("name")="value"
 
Share this answer
 
Comments
sunny dhiman 28-Dec-11 5:37am    
Thanks for your reply.Currently i am using session but can we make full application with the help of sessions ?
You can use following techniques:

Client Side:
1. Cookies
2. Cache
3. HttpContext
Server Side:
1. Session
2. Application
It depends on your data which you want to send.
 
Share this answer
 
Comments
sunny dhiman 28-Dec-11 5:38am    
I want to send data which i am getting from database
[no name] 28-Dec-11 6:21am    
just assign that data to your session variable
ie
sessin["dataValue"]=//value from database

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