Returning a 404 results in: XML Parsing Error: no element found

Prototype

New Member
I have the following in the codebehind of a page:\[code\]HttpContext.Current.Response.Clear();HttpContext.Current.Response.StatusCode = 404;HttpContext.Current.Response.End();\[/code\]But I get (In the browser. Visual Web Developer doesn't throw any exception):\[code\]XML Parsing Error: no element foundLocation: http://localhost:...Line Number 1, Column 1:\[/code\]I tried putting those lines in the \[code\]MasterPage\[/code\] but it didn't make a difference. I even tried putting them in a \[code\]PreRenderComplete\[/code\] event handler.So why is it showing that error?EDIT: I tried uploading it to my web-host, and it returned a normal 404. So why is it different in Visual Web Developer? Or perhaps it depends on the host, and will not always be OK?
 
Back
Top