![]() |
#2
happy8862010-02-23 18:23
|
protected void Page_Load(object sender, EventArgs e)
{
try
{
int y = 0; int x = 1 / y;
}
catch(Exception ee)
{ if(ee.Message =="试图除以零。")
throw new Exception("404"); //这里有问题 就是不会改啊?!
}
}
在web。config中这样写
<customErrors mode="RemoteOnly" defaultRedirect="Default.aspx">
<error statusCode="403" redirect="Default3.aspx"/>
<error statusCode="404" redirect="Default2.aspx"/>
</customErrors>
可是在运行测试时出现错误!!就提示一个一个错误:404
怎么不会跳转到我想要的地方去呢?
我想让他跳到Default3.aspx
请指教!
只有本站会员才能查看附件,请 登录
如图: