Re: Response.StatusCode problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Not sure why you are attempting to use Response.StatusCode in this manner.
What you could do is in you SQL if the user was not found return zero then
check for values greater then zero and perform whatever action you wish from
the returned value.



Regards,

Brian K. Williams



"SushiSean" <SushiSean@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B8B88D0B-D371-43B3-8CC2-DEEB63F6D85C@xxxxxxxxxxxxxxxx
Hello. I need use http header StatusCode as response.
For example my page have name check.aspx and I get request like this
check.aspx?idcustomer=1395

I use this idcustomer param to check if this customer exist in my database
and if exist show page (http StatusCode == 200), but if customer with
number
1395 not exist I need make 404 http error (page not exist)

I am tring to do something like
protected void Page_Load(object sender, EventArgs e)
{
Response.StatusCode = 404;
Response.End();
}

but it doesn't work. Can you somebody help me with it?


.


Quantcast