473,472 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HttpHandler Redirection

I have an HttpHandler that I use for processing file downloads. This files
are currently contained within a database and everything works great. The
problem I'm having is that if someone requests a file that doesn't exist -
they are currently getting and emply file rather than the standard Error 404
page. I'd prefer to be able to redirect them to the stanard 404 page but
can't figure out how this is done. Can someone help me out with this?

TIA
Brian
Nov 19 '05 #1
1 898
In your handler simply set Response.StatusCode to 404.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have an HttpHandler that I use for processing file downloads. This
files are currently contained within a database and everything works
great. The problem I'm having is that if someone requests a file that
doesn't exist - they are currently getting and emply file rather than
the standard Error 404 page. I'd prefer to be able to redirect them
to the stanard 404 page but can't figure out how this is done. Can
someone help me out with this?

TIA
Brian


Nov 19 '05 #2

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

Similar topics

2
by: Hanse Davion | last post by:
Can anyone provide some insight on what this problem could be? I have searched the web, read forums, and all the installation documentation for the dotnetnuke feeware portal from asp.net. I am...
4
by: Sean | last post by:
Hi all, Is it possible to use a custom HttpHandler to handler request that does not provide a specified page? e.g. http://www.aaa.com/there/is/no/such/document I tried to handle this request...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
3
by: Martin | last post by:
Hi, I have a number of documents stored on my web server and these documents should not be servered to anybody unless the user is both authenticated and authorized. This authentication and...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
1
by: Zeba | last post by:
Hi ! My web.config contains the following entry to direct all urls containing /App/*.ashx to my Apphandler located in wwwroot/mySite/Web/ AppHandler <httpHandlers> <add verb="*"...
6
by: Mike | last post by:
Hi, I have a problem of page redirection. Basically, the user has to connect to the local web server, but some pages need to be served by a remote server, because it contains some confidential...
5
by: zlf | last post by:
Hello, I try to use a custom HttpHandler to add something to session, then display the original page. public void ProcessRequest(HttpContext context) { context.Session = "test"; } But, a...
3
by: Guzeppi | last post by:
if i want to create a redirection service, i.e. requests on a certain url are redirected to other urls depending on the querystring parameters in the request, what is best to use in this case...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
1
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...
0
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.