Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sessions

Posted on 2004-05-03
5
Medium Priority
?
209 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 1000 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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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 …
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

722 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