Results 1 to 14 of 14

Thread: redirection

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43

    redirection

    I have a page that processes some script. After it does this I want to send the user to a different page. I don't think I can use response.redirect. Does anybody know how to do this.

  2. #2
    kayoca
    Guest
    Why not open a new page and use a meta tag for redirecting to a page or use javascript client side for redirecting.
    Code:
    <meta http-equiv="refresh" content="1; URL=mypage.asp">\

  3. #3
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    There should be no reason why you can't do a response.redirect unless you are passing information to another page. In that case you could do a response.redirect with querystrings of the information you are passing in the URL.
    i.e.
    Code:
    Dim FirstName, LastName, Email, Password
    FirstName = Request.Form("txtFirstName")
    LastName = Request.Form("txtLastName")
    Email = Request.Form("txtEmail")
    Password = Request.Form("txtPassword")
    Response.Redirect "page.asp?FirstName=" & FirstName & "&LastName=" & LastName & "&Email=" & Email & "&Password=" & Password
    %>
    That will take the information submitted by the form to the script and store it in querystrings to which you can use it in the next page by saying:
    Code:
    <%
    Response.write Request.Querystring("FirstName")
    %>
    Hope that helps!!!
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    here is my code:

    <%
    Set objBuilder = Server.CreateObject("BuilderComponent.Start")
    objBuilder.Start
    Set objBuilder = Nothing
    %>

    <%
    Response.Redirect "Results.asp"
    %>

    here is my error:

    "The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content."

  5. #5
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    What are you using that object for?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    The object is processing a query. I save the results in a text file on my server. I want send the user to a new page that will show the results.

  7. #7
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    Send me your asp file.
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  8. #8
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168
    If any header information is printed to the page, you will get this error with REsponse.Redirect. I don't know where this header stuff is being printed (perhaps by your component). Either do not print any html whatsoever (even a blank space) and do the response.redirect:

    Code:
    <% 
    Set objBuilder = Server.CreateObject("BuilderComponent.Start") 
    objBuilder.Start 
    Set objBuilder = Nothing 
    Response.Redirect "Results.asp" 
    %>
    Or use javascript to redirect:

    Code:
    <script langauge="javascript">
    window.navigate("Results.asp");
    </script>
    Wydok

    "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."

    -John Von Neumann ca. 1949

  9. #9

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    here it is
    Attached Files Attached Files

  10. #10
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Here:
    VB Code:
    1. Server.Execute ""
    I don't believe that requires HTTP headers. If it does, try Server.Transfer "".
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  11. #11

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    My server doesn't support this. Maybe it is my version of asp. How can I figure out what version I'm using and how to upgrade?

  12. #12
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    First U can use response.redirect even after processing....like this:

    the response.buffer = true shd be right at the top (only after @language stm).
    Code:
    <% response.buffer = true %>
    
    <% 
    'processing whatever 
    
    
    response.redirect "towhateverpage.asp" ' here u can add querystring if u wanr 
    %>
    This will may sure u dont get the error :

    "The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content."


    Secondly server.transfer does not work with IIS 4.0 , its added only in IIS 5.0 (Win2K)

    Also if u use server.transfer then u cannot pass querystrings.

    I hope this solves ur q.

  13. #13

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    Thanks, I will use response.buffer. The only thing with this is that while I'm buffering my page I can't give the user any feed back. I wanted to show a message telling them to wait, because my script takes several minutes to complete.

  14. #14
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    though using response.buffer may make it appear that u page is taking a bit long to load - buy actually once it starts loading it comes faster.

    also uu can show a layer from the calling page till ur next page is dispayed. though it may not be very helpful - but still

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width