首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

更改HTTP异常状态为404

2013-02-04 
更改HTTP错误状态为404using Systemusing System.Collections.Genericusing System.Linqusing System.W

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

热点排行