Application_Error Global.asax, . 404 . 404 404?
, . Server.GetLastError():
, , HttpException - . , HttpException, , Http, , . GetHttpCode(), Http 404.
void Application_Error (object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex is HttpException)
{
if (((HttpException)(ex)).GetHttpCode() == 404)
Server.Transfer("~/Error404.aspx");
}
Server.Transfer("~/DefaultError.aspx");
}
amexn source
share