我的错误页是这样写的:
<head runat="server">
<title>网站错误页面</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<a><b>错误页:</b> </a>
<a><font color=red><%=Request["ErrorUrl"] %></font></a>
<a><b>错误信息:</b></a>
<asp:Button ID="BackBtn" runat="server" Text="返回" /><a><font color=red><%=Request["ErrorMsg"] %></font></a></div>
</form>
</body>
</html>
CS代码:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackURL"] = Request.UrlReferrer.ToString();
}
}
protected void BackBtn_Click(object sender, EventArgs e)
{
Response.Redirect(ViewState["BackURL"].ToString());
}
---------------------------------------------------------------------------------
产生错误的页面的跳转语句:
catch (Exception ex)
{
Response.Redirect("../ErrorPage.aspx?ErrorMsg=" + ex.Message.Trim() + "&ErrorUrl=" + Request.Url.ToString());
}
[求助]跳转到错误页是乱码的问题