Solved

sessions

Posted on 2004-05-03
5
201 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:Saqib Khan
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:Saqib Khan
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:
Saqib Khan 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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