Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 17th, 2004, 06:09 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old January 17th, 2004, 07:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
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)
Reply With Quote
  #3 (permalink)  
Old January 18th, 2004, 07:22 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Belgium.
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
Reply With Quote
  #4 (permalink)  
Old January 20th, 2004, 01:35 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12: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



All times are GMT -4. The time now is 01:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.