473,659 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forcing An HTTP Response From the Server?

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.

Mar 2 '07 #1
2 1275
"pbd22" <du*****@gmail. comwrote in message
news:11******** **************@ 31g2000cwt.goog legroups.com...
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.asp x" mode="On">
<error statusCode="500 " redirect="serve rerror.aspx" />
<error statusCode="404 " redirect="filen otfound.aspx" />
<error statusCode="403 " redirect="acces sdenied.aspx" />
<error statusCode="204 " redirect="nocon tent.aspx" />
</customErrors>

http://www.google.co.uk/search?sourc...econfig%22+404
Mar 2 '07 #2
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 Kesting
Mar 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1431
by: Mark | last post by:
Hi - I have a document management system in ASP/VBScript, which copies files to a http://www./files directory. While uploading files to that directory, it also updates a database with full path information, and user groups allowed to see the file. To get access to the file list, a user needs to login - their login is associated with a group list, which as above, permits them to see a file list of files with the appropriate group...
1
3385
by: Robert Huie | last post by:
Hi all, I'm trying to use asp.net to code a chat window and I would like to make the http request delay as long as possible till the process/thread detects a new incoming message. basically something like the following: while(nonewmessages) { nonewmessages = checkfornewmessages();
2
1298
by: MWells | last post by:
I have a simple project server which shares files from within our network. The ASP.NET front end uses a database to authenticate users, and then based on their permissions, reaches across the network to various project folders and enumerates the files within. When clicked on, the file is retrieved and streamed back across the network to the webserver and then back to the requestor. All of this works great; however, since the original...
6
3060
by: G Dean Blake | last post by:
in my aspx app I am writing a stream that works fine but it replaces what is in the client browser window. The code is as follows: .. .. HttpContext.Current.Response.ClearHeaders() HttpContext.Current.Response.ClearContent() HttpContext.Current.Response.ContentType = "application/pdf" Dim myBuffer(MyStream.Length) As Byte MyStream.Read(myBuffer, 0, CType(MyStream.Length, Integer)) HttpContext.Current.Response.BinaryWrite(myBuffer)
3
1127
by: Tin Man | last post by:
I have an aspx page: myPage.aspx that I want to always display in a new brower window regardless of how it gets invoked i.e. hyperlink, response.redirect, server.transfer. Is there something I can embed in the HTML to cause this? Maybe some javascript or something like that? Thanks in Advance, tin man
6
1896
by: MattC | last post by:
Hi, If I add the following line to Application_BeginRequest Request.Headers.Add("Accept-Encoding", "gzip"); Will this cause the server to utilise IIS6.0 Compression even if the client is not set to use HTTP 1.1. Does the browser need to know that it sent the request in HTTP 1.1 in order to decompress or can it determine from the Response header that it needs to enflate/unzip.
2
10010
by: Sergey Poberezovskiy | last post by:
Hi, I have an application where I need to ensure that users do not use browser navigation buttons. I specifically warn the users, and in every page set the folllowing: Me.Response.Cache.SetNoStore() Me.Response.Cache.SetNoServerCaching() Me.Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache) and issue a GUID for every page. Then on page load I check whether the GUID passed from the last page is the same as in Session,...
3
1817
by: Don | last post by:
Is it possible to create a link which will cause either A) the server to serve a fresh copy of a file or B) the browser to "refresh" the copy of the file. Doing it via a link is the only possibility that I think would be viable for our situation, as changing HTTP headers isn't really feasible/desired right now (think 'expires' or 'no-cache'). Also, the file is non-HTML, so adding a 'no cache' meta tag to the file itself won't work. ...
3
2588
by: Ken Fine | last post by:
I am using ASP.NET's CreateUserWizard control. I want to force the visitor to use a username and e-mail address that I am providing in programming, and I do not want the visitor to be able to edit the forms input. I am aware that I can roll my own Create User form by using the membership API, but I am lazy and want to use most of the CreateUserWizard control's features. I tried converting the form to a template and setting the UserName...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.