ASP.NET 页面404设置
Web.config<system.webServer><!--404-->
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404"/>
<error statusCode="404" responseMode="ExecuteURL" path="/404.aspx"/>
</httpErrors>
</system.webServer>
404.aspx
<%@ Page Language="C#"%>
<script runat="server">
/// <summary>
/// 页面载入
/// </summary>
protected void Page_Load(object sender, EventArgs e)
{
Response.Status = "404 Not Found";
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>404 Not Found</title>
</head>
<body>
404 Not Found
</body>
</html>来源:C#社区
网址:www.hicsharp.com
天书奇谭,建议列为中文专业博士学位答辩翻译必考题目。 真是难得给力的帖子啊。
蹲一波同款,有没有姐妹 / 兄弟推荐? 水个经验,楼主加油,支持你~ 我先占个楼,等下再慢慢看~ 这波分析到位,逻辑满分! 说得对!狠狠赞同,没毛病~ 路过混个脸熟,顺便为优质内容打 call~ 谁懂啊!这内容我能循环看十遍
页:
[1]
2