Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2004, 07:09 PM
Authorized User
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing a variable using response.redirect

Hi,
I'm tring to pass a variable from my database to another page so I can do a query on the variable(member number)..
I saved the data in a variable and tried to pass it, but it doesn't work. here is my code.

***here I get the member info from the database

 mySQL = "SELECT memberemail, memberpassword, memberID, contractorID FROM memberinfo WHERE";
 mySQL = mySQL + " memberemail = '" + Request.Form("txtEmail") + "'";
 mySQL = mySQL + " AND memberpassword = '" + Request.Form("txtPassword") + "'";
 adoRecordSet = adoConnection.Execute(mySQL);




// Loop through recordset and write stock details out to page
  if( adoRecordSet.Eof == false )
   {
***here I am TRYING to save the contractorID number in the variable "contractID"(yes i declared this variable above as var contractID"

    contractID = adoRecordSet("contractorID");
    Response.Cookies("IsValid") = "Yes";
****the line below doesn't work when I put <%=contractID%>
    Response.Redirect("memberpage.asp?contractorID=con tractID");

any ideas?
thanks
Kathleen
 
Old January 17th, 2004, 08:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try something like :

Response.Redirect("memberpage.asp?contractorID=" & contractID)

or :

Dim myRedirectURL="memberpage.asp?contractorID=" & contractID
Response.Write(myRedirectURL)
' uncomment the following line once you are sure that the line above works.
'Response.Redirect(myRedirectURL)
 
Old January 18th, 2004, 08:22 AM
Authorized User
 
Join Date: Jun 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by katie456
// Loop through recordset and write stock details out to page
if( adoRecordSet.Eof == false )
{
above isn't vbscript

try this (including greg's remark; adding <%=...%> into somthing that is already vbscript does not work, it only works in plain html)

if not adoRecordSet.EOF then
contractID = adoRecordSet("contractorID");
Response.Cookies("IsValid") = "Yes"
Response.Redirect("memberpage.asp?contractorID=" & contractID)
end if
 
Old January 20th, 2004, 02:35 AM
Authorized User
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

would the synatax be the same if i was using javascript? with the exception of using var instead of Dim?





Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 27th, 2006 08:57 AM
how to post variable on response.redirect????? Swetz Classic ASP Components 3 May 16th, 2006 06:37 AM
response.redirect crmpicco Classic ASP Basics 3 February 9th, 2005 01:50 AM
ddl response.redirect and passing value dorothee ASP.NET 1.0 and 1.1 Basics 0 June 11th, 2004 03:14 AM
Response.Redirect dhborchardt Classic ASP Basics 4 June 16th, 2003 05:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.