[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I pass the QueryString in ASP with a Redirect?

Posted on 1999-01-09
1
Medium Priority
?
190 Views
Last Modified: 2013-12-25
I am attempting to do the following:

I have an html page that has a form the user fills out. When the user hits the submit button I POST the query string to an ASP. What I would like that ASP to do is display a message to the client, write the form information to a database, and then redirect the client to another ASP that will give the user the opportunity to print a copy of the form he/she just filled out.

I’m a little confused on how to pass the Request object’s query string to the page that will allow the client to print the information. So I guess to put my first question in a nutshell I could ask it as follows:

“How do I pass the querystring from the first page a client accesses to the third page the client accesses using a redirect within the second page?
0
Comment
Question by:fishhead
[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
1 Comment
 
LVL 28

Accepted Solution

by:
sybe earned 200 total points
ID: 1857847
There are at least 2 ways to do this:

================
method 1.

1st page = form

2d page:
<%
'first your code to store info into database

'the following line will pass the form data as a querystring
'to the third page
Response.redirect("thirdpage.asp?" & Request.Form)
%>

It might be that there will be too much data to put into a querystring (especially when the form contains Textareas)

Then use method 2:
=========

method 2.

<%
' secondpage.asp
' your code to put data into the database
' make sure you retrieve the id (autonumber) from the new record


Response.redirect("thirdpage.asp?id=" & newID)

%>

<%
' third page
' retrieve the data again from the database, using the id you
' have in the recordset

'display the data
%>


==========

Note: Response.redirect works only when NO response is send to the browser, not even "<HTML>", so make sure that the second page has only code between <% and %>.




0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

656 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