Hot to prevent sending an HTML from asp.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

How do i prevent my asp application to send back a html to the client ? I
want my asp to send only the http header response without some html trail.
I tried to delete the aspx content but still my browser gets an empty html.
I dont want any html!

How can i do that ?

Thanks
 
Response.close() afaik?
If that doesn't work, you'll need a generic handler instead and simply not
return any data, not a real way to do it though.
 
Your browser is unlikely to be only making a head request, so your webserver
will action a get/post and asp.net will respond accordingly by returning a
page rather than just a header.

I am guessing the only place to do this would in the pipeline via an
ihttpmodule. You would have to intercept the processing of the asp.net
response, clear the existing response, write the appropriate header, flush
the buffer and end the response. However, if the browser is making a
get/post - it will expect to get a Response.StatusCode = 200 returned or it
may see the response as flawed.

Regards

John Timney
Microsoft MVP
 

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

Back
Top