how to use session in asp.net
  • hi can anyone explain me how can we use session in asp.net using c# i want to pass data between form using session please give any proper example for session.
  • 1 Comment sorted by
  • Hi @gopal,
    session is an array variable which can be store in server ram and as well as in SqlServer ,
    Normally we use Session as a Login status of any user but we can store much more things like DataTable , List , etc etc,
    here is an Example of DataTable ,

    Datatable xtb (Fill with data )
    us can save this datatable in Session like this ,

    Session["DataTable"] = xtb;

    Or you can retrive data from it like this
    DataTable xtb1 = Session["DataTable"] as DataTable;

    and for finishing Session use
    Session.Abandon();

    if u want example project feel free to ask


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

    Optimum Creative