Solved

sessions

Posted on 2004-05-03
5
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

636 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