Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forwarding a form to a second ASP page 2

Status
Not open for further replies.

phillyman

Technical User
Apr 15, 2001
9
CA
Hi everyone...

I have somewhat of a large form that is sent to an ASP page for processing. I would like to be able to take the form and forward it to a third ASP page without having to redo the entire form or save a bunch of new parameters.
Is there a way to forward a form to another page and maintain it's structure?

Scott Wilkinson
 
Scott,

The only way I can think of you doing this without having to write the form twice would be to write the form in an include page. Then call that include page in both pages. Can you be more specific on what you're trying to perform, there may be a better way. Do you want the values that were entered into the form on page #1 to be displayed on the form in page #3 ??

ToddWW :)
 
I wonder if you enable buffering (Response.Buffer = True) and then before writing any HTML headers will redirect the page to some other page (Response.Redirect(yourURL)), will the thrid page get all the posted data via Request.Form("yourFormElement")??? You can try it. ---
---
 
Is the second page going to have a submit form? If not, after you're done processing it, use the Server.Transfer function to pass the page off to your 3rd asp page. All the requests will stay in place.

If not, try using this code, this will print out all your fields in your request object:

for each formobj in Request.Form
Response.Write &quot;<input type=&quot;&quot;hidden&quot;&quot; name=&quot;&quot;&quot; & formobj & &quot;&quot;&quot; value=&quot;&quot;&quot; & request(formobj) & &quot;&quot;&quot;>&quot;
next
 
From Wrox ASP 3.0...

&quot;The transfer method stops execution of the current page and transfers control to the page specified in the supplied URL. The user's current environment(session state and any current transaction state) is carried over to the new page.&quot;

Server.Transfer(url)

This actually may work what I need to do. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top