473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Response.Redirect & URL Variable

jschrader
Sorry that I'm reposting, but this topic is in an archive that I can't post to.

I am having a problem that I can not figure out...

I have a ASP form page /Quiz.asp that processes the form itself. and then has a redirect to a Confirmation.asp page I am trying to figure out how to pass off the PK_ID from the new record being create in the database to the new confirmation page so that they can see some of their information and quiz answers.

Below is the code, please let me know if you have any questions to better answer my question

Quiz.asp
Expand|Select|Wrap|Line Numbers
  1. sql="INSERT INTO ITQA(FName, LName, Email) VALUES('" & _
  2.             Request("firstname") & "', '" & Request("lastname") & _
  3.             "', '" & Request("email") & _
  4.  
  5.     End Select
  6.     cn.Execute sql        
  7.  
  8.     Response.Clear
  9.     Response.Redirect "IT_QandA_Confirm.asp?ID="& Request("ID")
  10. end if
  11. %>
  12. <BODY>
  13. <form action="Quiz.asp" method="post">
  14. <input type="hidden" name="ID" value=<%=Request("ID")%>>
  15. <table>
  16.  <tr>
  17.   <th>Name :</th>
  18.   <td><input type="text" name="firstname" value="">
  19.     <input type="text" name="lastname" value=""></nobr></td>
  20.  </tr>
  21.  <tr>
  22.    <th >Email Address:</th>
  23.    <td><input type="text" name="email" value=""></td>
  24.  
Confirmation page (ive tried a couple different ways, but just need the ID to be passed along with it to pull up specific info)
Expand|Select|Wrap|Line Numbers
  1. <%
  2. 'Confirmation Form
  3.  
  4. Response.Write    "<HTML><Body>
  5. <P>Thank you for taking our little quiz...<P>" &_
  6. "Your entry will be put into our system and all of the top scores will be put into a drawing" &_
  7. "<b>Submitted By: </b>" + Request.Form("firstname") + " " + Request.Form("lastname") + "<br>" &_
  8. "<b>E-mail: </b>" + Request.Form("email") + "<BR>" &_
  9. "<a href=Quiz_Answers.asp?ID=" + Request.Form("PK_ID") + " >Check out your score here.</a></body></html>"
  10. %>
Mar 7 '08 #1
4 1549
I'm sure that I am missing something in calling the ID in the sql statement at the begining just to have the variable to redirect, but I can't figure out where it belongs...
Mar 7 '08 #2
idsanjeev
241 100+
I jschrader

just redirect on url "IT_QandA_Confirm.asp"
Expand|Select|Wrap|Line Numbers
  1.       Response.Redirect "IT_QandA_Confirm.asp"
  2.  
and store his id in cookies or session
select data acording to his id on confirm page to display

thanks
Mar 8 '08 #3
Example?
I'd like to keep it all in the asp code and not use cookie's if possible? Sorry, not an expert ASP developer by any means...

I jschrader

just redirect on url "IT_QandA_Confirm.asp"
Expand|Select|Wrap|Line Numbers
  1.       Response.Redirect "IT_QandA_Confirm.asp"
  2.  
and store his id in cookies or session
select data acording to his id on confirm page to display

thanks
Mar 10 '08 #4
jhardman
3,406 Expert 2GB
Example?
I'd like to keep it all in the asp code and not use cookie's if possible? Sorry, not an expert ASP developer by any means...
session variables are just a useful way to pass data from one page to another within the same site:
Expand|Select|Wrap|Line Numbers
  1. session("ID") = request("ID")
Once you put that line in a page the user visits (probably on the login confirmation page, right?) it is accessible from any page on your site. Let me know if htis helps.

Jared
Mar 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bill | last post by:
I have a page that contains processed variables that I'd like to forward using the response.redirect method. However, because the response.redirect contains the page within "pagename.asp", I have...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
4
by: TomT | last post by:
Hi.. I'm redirecting users to another page using: response.redirect("newpage.asp") this works... But I need to add a variable to the page specified.. IE: newpage.asp?id=JobID
1
by: John | last post by:
Hi, I have a routine that sets some session variables and then redirects the user to another page in the same application/ same folder. ======= Session("MyName") = "Fredsmith"...
3
by: Raterus | last post by:
Anyone know how I can figure out the figure out the response.redirect trail a browser goes through when I'm using response.redirect on the server. Right now Internet Explorer just automatically...
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
1
by: Don | last post by:
When we redirect a user to a new page, we generally want the processing of the current page to end right then. As I understand it, the runtime accomplishes this by generating a ThreadAbort...
9
by: postings | last post by:
Just a quick question... When I do a "response.redirect" from a source webpage to a destination webpage, does the code on the source webpage carry on executing unless I put a "response.end"...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.