Click here to Skip to main content
15,913,669 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
how to use session in asp.net ?

plz give me proper advice...

Thanks in Advane..
Posted

Hi,

here's how,

C#
Session["Sample"] = "sample string";

string text = Session["Sample"}.ToString();



Thanks :)
 
Share this answer
 
 
Share this answer
 
Hi,

Check This One,

ViewState["dtDemo"] = dtDemo;
Here dtDemo is Datatable Saved in ViewState .

C#
Datatable dt = (DataTable)ViewState["dtDemo"];
Here dtDemo is Datatable Saved in
ViewState and is retrieved to Datatable dt.

Hope This May help you.
 
Share this answer
 
v2
Comments
D K N T H 21-Mar-12 1:29am    
code tags added :)
 
Share this answer
 
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Mar-12 23:29pm    
Recursion detected.... :-)
--SA
Am Gayathri 10-May-13 8:02am    
:D :D

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