Connecting Tech Pros Worldwide Help | Site Map

Forcing An HTTP Response From the Server?

pbd22
Guest
 
Posts: n/a
#1: Mar 2 '07
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.

Mark Rae
Guest
 
Posts: n/a
#2: Mar 2 '07

re: Forcing An HTTP Response From the Server?


"pbd22" <dushkin@gmail.comwrote in message
news:1172845069.766283.227440@31g2000cwt.googlegro ups.com...
Quote:
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?sourc...econfig%22+404


Hans Kesting
Guest
 
Posts: n/a
#3: Mar 2 '07

re: Forcing An HTTP Response From the Server?


Hi.
Quote:
>
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 Kesting


Closed Thread