G
Guest
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?
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?