Используйте обработчик события Application_Error в файле global.asax, чтобы перенаправить пользователя в ~ / error / meh.aspx
в global.asax
protected void Application_Error(object sender, EventArgs e)
{
Response.Redirect("~/error/404.aspx");
}
В вашем файле web.configтакже добавьте
<customErrors mode="On" defaultRedirect="/error/404.aspx" />