Link to home
Start Free TrialLog in
Avatar of willa666
willa666Flag for United States of America

asked on

sessions

I have a page that displays a record set in a repeat region, i want to be able to click on one of the records and be able to store the unique ID in a session varible and then have that session varible used to request a recordset that is displayed on page two.

IE

PAGE 1

Name          value
Willa                1
John                 2
Paul                  3

Now if i clicked on Willa, the value 1 would be stored into a session varible called MM_TEMP_USERID,
Then that session varible would be used on page2 to creater a recordset.

So the things that i want to know are

Should i be storing the value for the session on page1 or page 2? if i store it on page1 then how owuld i get it to redirect off to page2 to create the record set after the session has been created and if the session is created on page 2 then how will it create the record set in one load of the page.

Willa
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Why do you need Session Variable For?
Your are planning to have its value on multiple pages? if yes then makes sense.
otherwise you can just pass the Value to second page like this

<a href="page2.asp?VALUE_TO_PASS=1"> Willa </a>

Then on page 2

My_Value = Request("VALUE_TO_PASS")

Now you can use this variable in your RS.

and if you really want to generate the session thats how its done

Session("A") = Request("VALUE_TO_PASS")
so we generated it on page2.

Good luck.
Avatar of willa666

ASKER

So does the creation of the session varible need to be before the recordset? otherwise i guess that the recordset will not be able to us the session.
Yes you absolutely Right.
As I assume you feeding the Value of Session Variable to your Recordset.
yeap i am!

OK I will go off and try this then.

are you any good with store procdures as well?

I have a SP that i us for lost passwords it searches for  the user account and then sends the users account detail to them via SQL mail.

But when IN DW i set the values for the SP and i have set it so that if it is sucssesfull it return a value of 1 if not then a 0 is returned. can i build it in so that i can auto redirect the page if the return vlue is '1' ?

here is the code that is generated by DW. the return value is called @RETURN_VALUE

<%
Dim RESEND_USR_ID__userid
RESEND_USR_ID__userid = "gsmith@ncl.com"
if(Request("userid") <> "") then RESEND_USR_ID__userid = Request("userid")
%>
<%
set RESEND_USR_ID = Server.CreateObject("ADODB.Command")
RESEND_USR_ID.ActiveConnection = MM_IPS_STRING
RESEND_USR_ID.CommandText = "dbo.SendMyMails"
RESEND_USR_ID.Parameters.Append RESEND_USR_ID.CreateParameter("@RETURN_VALUE", 3, 4,1)
RESEND_USR_ID.Parameters.Append RESEND_USR_ID.CreateParameter("@userid", 200, 1,30,RESEND_USR_ID__userid)
RESEND_USR_ID.CommandType = 4
RESEND_USR_ID.CommandTimeout = 0
RESEND_USR_ID.Prepared = true
RESEND_USR_ID.Execute()
%>

Willa
ASKER CERTIFIED SOLUTION
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial