Print Page | Close Window

response.redirect

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5446
Printed Date: 30 March 2026 at 9:29pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: response.redirect
Posted By: group1
Subject: response.redirect
Date Posted: 02 September 2003 at 8:08am

I was just wondering is there a maximum number of pages a response.redirect can use?

For example i have a form :-

1. which is submited to an asp page which creates a session, then response.redirect is used to:

2. place data in a table in a database, which then uses response.redirect to:

3. add data to a different table in a database, which then uses respnse.redirect to:

4. Email the user the autonumber made in the database, which then uses response.reidrect to:

5. output a html page to the user of the autonumber assigned to a booking

 

All up to submit a booking, about 5 pages carry on behind the scenes on the server, using the response.redirect command. Sometimes this causes errors. is there a maximum number of pages u can use this command before it stuffs up?

 

Also should i be using response.flush anywhere? I don't really understand how it works?

Thanks

Simon




Replies:
Posted By: karp13
Date Posted: 02 September 2003 at 8:21am
You can do all of that stuff on the same page as the form.


Posted By: ljamal
Date Posted: 02 September 2003 at 10:14am
Why do the redirects when it can all be done in one page?



-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: b_bonnett
Date Posted: 02 September 2003 at 9:53pm

If Len(Request.Form) > 0 Then
     'Form already submitted
     Create The Session ...
     ... Place data in first database table ...
     ... Place data in second database table ...
     ... Email the user ...
     ... Output the HTML

Else
     Display the form ...
End If

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: peterm
Date Posted: 05 September 2003 at 4:24am

Response.Redirect tells the browser to request a different page, so you are effectively making the user go to each page one after another - this is bad as it causes unnecessary network traffic, you can do everything within one ASP page.

To keep it simple though, have one page with the HTML form on that the user populates and submits and one ASP page with the ASP code to update the database, email the customer and send the HTML success/failure information. 

I would put something like "createuser_code.asp?action=save" as the form action and then in createuser_code.asp have something like:

If Request("action") = "save" Then
  Call emailCustomer(updateDatabase())
End If

Function updateDatabase()
  'Code to make the database changes
  'Code to retreive identity value (intIdentity)
  updateDatabase = intIdentity
End Function

Function emailCustomer(intIdentity)
  'Code to email the customer with the intIdentity value
End Function

<%' Below put the HTML output saying the email has been generated %>




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net