Solved

sessions

Posted on 2004-05-03
5
196 Views
Last Modified: 2010-04-25
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
0
Comment
Question by:willa666
  • 3
  • 2
5 Comments
 
LVL 23

Expert Comment

by:adilkhan
ID: 10979713
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.
0
 
LVL 1

Author Comment

by:willa666
ID: 10979865
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.
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 10980295
Yes you absolutely Right.
As I assume you feeding the Value of Session Variable to your Recordset.
0
 
LVL 1

Author Comment

by:willa666
ID: 10980378
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
0
 
LVL 23

Accepted Solution

by:
adilkhan earned 250 total points
ID: 10980685
After your above Code...
<%
R_Value = RESEND_USR_ID("@RETURN_VALUE")


 if R_value = 1 Then

response.redirect "page.asp"
Else

Response.write "Msg here"

End if

%>
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Set up local email server on Macbook w/CF 5 388
SWF won't scale? 4 518
Debug application start 2 273
Edit Muse Website with Dreamweaver 6 893
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now