Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - response.redirect
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

response.redirect

 Post Reply Post Reply
Author
group1 View Drop Down
Newbie
Newbie


Joined: 20 August 2003
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote group1 Quote  Post ReplyReply Direct Link To This Post Topic: response.redirect
    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

Back to Top
karp13 View Drop Down
Groupie
Groupie
Avatar

Joined: 03 January 2002
Location: United States
Status: Offline
Points: 152
Post Options Post Options   Thanks (0) Thanks(0)   Quote karp13 Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2003 at 8:21am
You can do all of that stuff on the same page as the form.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2003 at 10:14am
Why do the redirects when it can all be done in one page?

Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post 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, The Plane Gallery
Greetings From Christchurch
Back to Top
peterm View Drop Down
Newbie
Newbie


Joined: 24 November 2002
Location: United Kingdom
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote peterm Quote  Post ReplyReply Direct Link To This Post 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 %>

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.