IsmailS
IsmailS

Reputation: 10863

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?

Upvotes: 10

Views: 12727

Answers (2)

Guffa
Guffa

Reputation: 700472

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.

Upvotes: 10

lak-b
lak-b

Reputation: 2113

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.

Upvotes: 4

Related Questions