Setting session variables

Results 1 to 3 of 3

Thread: Setting session variables

  1. #1
    Chandra Poludasu Guest

    Default Setting session variables

    I am a new ASP programmer. I am stuck at setting the session variables so as to pass them to the next page. I am able to return a recordset containing four rows onto a page, and the values of these rows with four columns are to be displayed to the next three available pages. How can I see these values over the next available asp pages<BR>

  2. #2
    Sateesh Guest

    Default RE: Setting session variables

    There are many ways to pass a recordset values from one page to the other<BR><BR>1. Assign the resultset to a session variable so that you can use the same result sets in all the other three pages (by doin this the performance might go down)<BR>2. Convert all those resultset row and cloumn values into a single value by using the join function and assign it to a hidden variable and in all the other pages use the split function to split the values and display those.<BR>3.Open the same resultsets in the other pages also.

  3. #3
    Join Date
    Dec 1969

    Default RE: Setting session variables

    If I&#039m reading what you are saying correctly, you can do it like this.<BR><BR>&#060;%<BR>x = 1<BR>DO WHILE NOT RS.EOF = TRUE<BR><BR>session("Col1Row" & x) = rs.fields("Column1")<BR>session("Col2Row" & x) = rs.fields("column2")<BR>session("col3Row" & x) = rs.fields("column3")<BR>session("col4Row" & x) = rs.fields("column4")<BR><BR>x = x + 1<BR>RS.MOVENEXT<BR>LOOP<BR>%&#062;<BR><BR>I haven&#039t tested this so I&#039m not sure whether it will work, although it should...<BR><BR>you will then have a series of Session variables set.. i.e<BR><BR>session("col1row1"), session("col2row1"), session("col3row1"), session("col4,row1")<BR><BR>and<BR><BR>session("co l1row2"), session("col2row2"), session("col3row2"), session("col4,row2")<BR><BR>so on and so forth until the end of the recordset...<BR><BR>You can now use them until as much as you want... and the sessions will be destroyed when the user closes the browser.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts