need clarity -- Response.Clear, .ClearHeaders, .Buffer

M

matt

hello,

so from time to time i have to write code to send a file or a stream
back to the end user. in my mini library i have code to do so. however,
some of the Response object properties arent exactly clear to me, and
for some reason they arent spec'd out in my v1.1 SDK.

can anyone provide a simple break down of the intended purpose &
appropiateness of these:

Response.Clear()
Response.ClearHeaders()
Response.Buffer

....thanks!

matt
 
M

matt

Peter said:
Matt,
If you read the MSDN Documentation on the HttpResponse class, you'll find
all these methods clearly spelled out:

thanks.

but if MSDN made everything clear, id be expert on everything ive read
there, and nobody would buy books :)

while those are useful technical explainations of what each method
does, i dont know that i would say they clearly spell things out... for
example, when reading the "HttpResponse.Clear Method" entry, it says:

Remarks
The Clear method does not clear header information.

yet, in the code sample it says:

// Set the page's content type to JPEG files
// and clear all response headers.
Response.ContentType = "image/jpeg";
Response.Clear();

....which seem contradictory to me (does it clear headers, or doesnt it?
but more importantly -- *why* do i want to clear headers!?)

so i guess what im looking for is more of a "Well, the basic idea of X
is xxxx. You really only need to use X when doing Y..." type
discussion.

for instance, im going to send the user an .XLS -- why is it important
to clear the response headers (.ClearHeaders) from my event handler's
routine? or to use .Clear? omitting the lines seems to make no
difference in my test environment.

or, when is it to the developer's advantage to enable output buffering
on the response?


....so can anyone comment on these HttpResponse items in more of a
non-tech-specs, general-rules-of-thumb fashion?


thanks!
matt
 
M

matt

Peter said:
Yep. I read this as you saying "I think I really need to study the HTTP
Protocol first". That will help, plenty of free tutorials on the web that
will explain what headers are, etc.

well, then i guess i view these groups a little differently. i was
hoping to initiate a discussion on the topic, not hunt the web for
articles. so you could say i wrote that saying, "I not an expert on
HTTP Protocol, and I'm not sure that I want to be. But, can anyone
offer the general gist of why these commands exist and when they are
actually necessary?"

im still interested in that sort of discussion, if any one cares to
chime in. if not, well then i guess there is a dead thread.


matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top