Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2003, 09:06 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default repsponse.redirect problem

I have some really weird things going on.

First here's my code:

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

Yep that's it.

This code is in the page root/admin/index.asp

If I try to browse to root/admin/index.asp, the browser just sits there forever and my dial-up connection shows that a ton of activity is going on (sending and receiving) but it never loads the page. If I remove that code, it loads the page no problem.

Next if I try to browse to just root/admin, the redirect sort of works, but it redirects it to the root directory, not the root/admin directory.

Of course as a programmer, I think that it may be a server problem or something. I am on an IIS server if that makes any difference. Any ideas as to what the heck is wrong?

Thanks!

Ray
 
Old June 8th, 2003, 10:48 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Ray-

A redirect will only work if nothing else was written out to the browser.

Are you sending data to the page first and then doing a response.redirect? If so you need to set Response.Buffer = True and then Response.Flush when your ready for everything to happen.




Hal Levy
Daddyshome, LLC
 
Old June 8th, 2003, 01:21 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the code for my entire page.

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Empty test page</title>
</head>

<body>

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

</body>

</html>
 
Old June 8th, 2003, 02:02 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Get rid of all the HTML markup. The only thing that should be on the page is the

Code:
<% Response.Redirect "loggedout.asp" %>
None of the <BODY> and other HTML markup. That's all stuff that gets sent to the browser before the redirect, and therefore the browser doesn't know how to handle it.



Hal Levy
Daddyshome, LLC




Similar Threads
Thread Thread Starter Forum Replies Last Post
Repone.Redirect() problem aliirfan84 ASP.NET 2.0 Professional 4 June 13th, 2007 08:29 AM
Response.Redirect Problem msbsam ASP.NET 2.0 Basics 0 February 10th, 2007 03:28 AM
Problem with redirect/replace gorros Javascript 4 March 11th, 2006 07:37 AM
problem with redirect.. joeore PHP Databases 2 February 17th, 2004 02:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.