Use of Response.Flush before Response.End

When to use Response.Flush? Do I need to call it every time before I call Response.End?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The Response.Flush method is used when you want to flush part of the content before the rest of the page. To have any effect response buffering has to be turned off, and you have to output the page content yourself using Response.Write rather than using aspx markup.

Method 2

You don’t need to call Respond.End in most cases. If you do, you have to know about your case and why are you calling Respond.End and about Flush. It is very case specific.

Also, MSDN cleared it out:

If Response.Buffer is set to TRUE,
calling Response.End flushes the
buffer. If you do not want output
returned to the user, you should first
call Response.Clear.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x