Forcing An HTTP Response From the Server?

P

pbd22

Hi.

I feel like i should know this but i dont.
How do I get the server to send a specific HTTP response to the
browser?

I want to tell the browser that there is no content coming back from
ther server and I want to do it in the HTTP Headers. The status code
is "204" for no content.

How do i do this? I am using VB.NET.

Thanks.
 
M

Mark Rae

I want to tell the browser that there is no content coming back from
ther server and I want to do it in the HTTP Headers. The status code
is "204" for no content.

How do i do this? I am using VB.NET.

Do you mean something like this in web.config:

<customErrors defaultRedirect="ErrorPage.aspx" mode="On">
<error statusCode="500" redirect="servererror.aspx" />
<error statusCode="404" redirect="filenotfound.aspx" />
<error statusCode="403" redirect="accessdenied.aspx" />
<error statusCode="204" redirect="nocontent.aspx" />
</customErrors>

http://www.google.co.uk/search?sour...=GGLG,GGLG:2006-28,GGLG:en&q="web.config"+404
 
H

Hans Kesting

Hi.
I feel like i should know this but i dont.
How do I get the server to send a specific HTTP response to the
browser?
I want to tell the browser that there is no content coming back from
ther server and I want to do it in the HTTP Headers. The status code
is "204" for no content.

How do i do this? I am using VB.NET.

Thanks.

You can set Response.Status to something like "204 No Content" (it's a string)
You probably then should call Response.End() to abort further processing
at the server.

Hans Kestin
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top