473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Response.End or not?

Hi there,
after looking at someone elses code here I noticed that he
always does a Response.End after a Response.Redirect. I was under the
impression that code execution would stop on the current page as soon as the
Response.Redirect statement appeared, but the guy reckons that the code will
continue running on the current page before starting the new one. Can
someone give me the definitive answer on this?
Jul 19 '05 #1
3 5509
Depending on the buffering that is set, sometimes that is true, sometimes it
is not. Response.End ensures it, and i find the use of response.end similar
to the practice of always closing and setting objects to nothing. There is
no harm in doing it, and it removes that as a potential investigation point
when the page goes wrong somehow...
"Waldy" <wa***@69.cock> wrote in message
news:#G**************@TK2MSFTNGP10.phx.gbl...
Hi there,
after looking at someone elses code here I noticed that he
always does a Response.End after a Response.Redirect. I was under the
impression that code execution would stop on the current page as soon as the Response.Redirect statement appeared, but the guy reckons that the code will continue running on the current page before starting the new one. Can
someone give me the definitive answer on this?

Jul 19 '05 #2
Here's a test, 69.cock:

<%

response.redirect "page2.asp"
Server.CreateObject("Scripting.FileSystemObject"). OpenTextFile("D:\file.txt"
, 2, True).Write "Still running"

%>

First, comment out the redirect and make sure that the file will be created
without errors, then delete the file, uncomment, and reload the page.

Ray at work

"Waldy" <wa***@69.cock> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi there,
after looking at someone elses code here I noticed that he
always does a Response.End after a Response.Redirect. I was under the
impression that code execution would stop on the current page as soon as the Response.Redirect statement appeared, but the guy reckons that the code will continue running on the current page before starting the new one. Can
someone give me the definitive answer on this?

Jul 19 '05 #3
Ray,
I can confirm that the file does not get created when I uncomment
the Redirect. This seems to suggest what I suspected, that no code gets
executed on the current page after a Redirect.

Thanks.
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
9
by: Dominic Godin | last post by:
Hi, I have an asp page that does a lot of processing and reports it's finished by printing the word "Success". For example: <% SomeFunction(SomeVar) SomeFunction(SomeVar1) ...
13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
0
by: PD | last post by:
I am trying to stream out a PDF file via the response object and when I execute the code it always brings up the first document that I pulled up.Even when I step through the code, I can see the new...
6
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
2
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. ...
0
by: Huxley Aldous | last post by:
This is my first program aside from hello world. It is still in progress. I would really like to know how to get a time stamp for the duration of the presentation of each question and the time...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.