读书人

更改HTTP异常状态为404

发布时间: 2013-02-04 10:50:22 作者: rapoo

更改HTTP错误状态为404


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class Error : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
throw new HttpException(404, System.Net.HttpStatusCode.NotFound.ToString(),456);
}
}


为什么报错,是什么东西没有引用吗
[解决办法]
不报错干嘛,你让人家报错的 throw new HttpException

读书人网 >asp.net

热点推荐