You must Sign In to post a response.
  • Category: ASP.NET

    How to set more than one value in session variable ?


    Are you looking for a way to set more than one value in session variable ? then read this thread to know how to do it



    hi sir,
    Actually i hve a gridview.in that i'am binding more then one value.so in this i'am taking product name based on label.that value stored in session.after page redirecting only first value can be displayed in another page. so i want display more then one products in checkout.aspx.
    sory for spelling mistakes but please understand this qution.
  • #757886
    you can create as many session objects as possible as session is maintained uniquely for each user on the server side. If you want to save more than one value in the same session object then you need to save them by separating them using a special character such as ~ and then while using the value separate them using split function and passing this ~ character as a separator.
    Miss. Jain
    Microsoft Certified Technology Specialist in .Net

  • #757888
    You can store complete array of multiple variable or even datatable can stored on session object if you want to multiple value in same session.
    Regards & thanks
    Arvind kumar
    Visit--blog.akumars.esoftera.in

  • #757901
    Hi Sadiq,

    Find the below example for storing and retrieving multiple values in a single session :

    List<string> Names = new List<string>{"ABC","DEF","XYZ"};

    Session["Example"] = Names;
    Names.Add("PQR");
    var example = Session ["Example"];

    Hope this will help you.
    Mark the answer if it helped you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #757940
    Dear


    Kinldy find the below mentioned Links. It may help u lot.

    1.http://forums.asp.net/t/1482529.aspx?how+to+pass+and+retrieve+multiple+values+from+session

    2.http://www.codeproject.com/Questions/404836/How-to-store-multiple-value-in-session

    3.http://aspdotnetcode.blogspot.com/2010/09/storingmultiplevalueinsession.html

    4.http://dilipkakadiya.blogspot.com/2011/09/how-to-store-multiple-value-in-session.html

    5.http://stackoverflow.com/questions/18439352/storing-and-retrieving-multiple-values-in-a-single-session

  • #758064
    hi every one,

    ok. My qution not perfect so i'am placing one picture see the picture and tell the answer
    My qution is in this i'am clicking proceed to chekout button in this only first row will be redirecting remainig rows not redirecting so please tell the answer as possible also related source code.
    Thanks and regards

    Delete Attachment


  • Sign In to post your comments