Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 864
IsmailS Avatar asked May 12 '10 05:05

IsmailS


2 Answers

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.

like image 115
Guffa Avatar answered Nov 11 '22 00:11

Guffa


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.

like image 21
lak-b Avatar answered Nov 11 '22 02:11

lak-b