Re: Throwing a 404 when rewriting urls

Tech-Archive recommends: Fix windows errors by optimizing your registry



"IanW" <spondishy@xxxxxxxxxxxxx> wrote in message news:c9bc13c9-5a75-4ce3-a39b-380cd074f363@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Should I create a 404.aspx page and server.transfer to that, or is
there some other way?

HttpContext.Current.Response.StatusCode = 404;
HttpContext.Current.Response.SuppressContent = true;
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

.