62,254
社区成员
发帖
与我相关
我的任务
分享
void Application_Error(object sender, EventArgs e)
{
//在出现未处理的错误时运行的代码
Server.ClearError();
//你要跳转的404页面
Response.Redirect("~/Sorry.htm");
}
<customErrors mode="RemoteOnly" defaultRedirect="PageError.htm">
<error statusCode="403" redirect="PageError.htm" />
<error statusCode="404" redirect="PageError.htm" />
</customErrors>