.NET 提供两种方法
1.web.config 中的 customErrors redirect
2.Global.asax 中的 Application_Error
都能定向错误页面,但只能在错误页面本身重定向,而 不能实现 整体框架的重定向
摸索了半天,无解......
求助中
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<frameset rows="70,*,29" cols="*" framespacing="1" frameborder="NO" border="1">
<frame src="head.aspx" name="topFrame" scrolling="NO" noresize >
<frame src="middle.aspx" name="middleFrame"scrolling="auto">
<frame src="foot.aspx" name="bottomFrame" scrolling="NO" noresize>
</frameset>
</html>
但
---------------------------------------------------------------
当页面出错时,程序会在服务器端直接转到错话页面,就像使用 Response.Redirect 方法一样,不能控件页面在哪个目标窗口中打开。
你可以重写页面的 OnError 方法,来自己实现错误页面的转向:
protected override void OnError(EventArgs e)
{
Server.ClearError();
string script = "<script language=/"javascript/">top.location = '" + url + "'";
Response.Write(script);
}
1.web.config 中的 customErrors redirect
2.Global.asax 中的 Application_Error
都能定向错误页面,但只能在错误页面本身重定向,而 不能实现 整体框架的重定向
摸索了半天,无解......
求助中
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<frameset rows="70,*,29" cols="*" framespacing="1" frameborder="NO" border="1">
<frame src="head.aspx" name="topFrame" scrolling="NO" noresize >
<frame src="middle.aspx" name="middleFrame"scrolling="auto">
<frame src="foot.aspx" name="bottomFrame" scrolling="NO" noresize>
</frameset>
</html>
但
---------------------------------------------------------------
当页面出错时,程序会在服务器端直接转到错话页面,就像使用 Response.Redirect 方法一样,不能控件页面在哪个目标窗口中打开。
你可以重写页面的 OnError 方法,来自己实现错误页面的转向:
protected override void OnError(EventArgs e)
{
Server.ClearError();
string script = "<script language=/"javascript/">top.location = '" + url + "'";
Response.Write(script);
}