日期:2014-05-17  浏览次数:20343 次

更改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