http://community.csdn.net/Expert/topic/5541/5541130.xml?temp=.2118647
我这里是把错误信息全都传过去
但是因为传的内容太多所以没有反应
这个要怎么办
2:
protected void Application_Error(Object sender, EventArgs e)
{
// 在出现未处理的错误时运行的代码
Exception ex = Server.GetLastError();
String Path = Request.Url.ToString();
String RePath = String.Format("/web/error/404page.aspx?aspxerrorpath={0}&Error={1}&Detail={2}", Path, Server.UrlEncode(ex.Message), Server.UrlEncode(ex.ToString()));
Response.Redirect(RePath, true);
HttpContext.Current.Server.ClearError();
}
这是我的错误处理
注意最后一行
HttpContext.Current.Server.ClearError();
是用来注册错误的
但奇怪的是我加多了这一行的时候
程序读这里要执行两遍
第二遍的时候就出错,因为错误给清除了
但是我去掉这一行又程序正常了我不解的是这里我们自己定义了错误的处理
最后应该清除错误才对啊
我这里是把错误信息全都传过去
但是因为传的内容太多所以没有反应
这个要怎么办
2:
protected void Application_Error(Object sender, EventArgs e)
{
// 在出现未处理的错误时运行的代码
Exception ex = Server.GetLastError();
String Path = Request.Url.ToString();
String RePath = String.Format("/web/error/404page.aspx?aspxerrorpath={0}&Error={1}&Detail={2}", Path, Server.UrlEncode(ex.Message), Server.UrlEncode(ex.ToString()));
Response.Redirect(RePath, true);
HttpContext.Current.Server.ClearError();
}
这是我的错误处理
注意最后一行
HttpContext.Current.Server.ClearError();
是用来注册错误的
但奇怪的是我加多了这一行的时候
程序读这里要执行两遍
第二遍的时候就出错,因为错误给清除了
但是我去掉这一行又程序正常了我不解的是这里我们自己定义了错误的处理
最后应该清除错误才对啊
而且URL好象有2K的字数限制,通过session什么的传吧
Session是每个浏览用户一个
Cache 是对全局来定的,例如某些子控件地重复使用,广告等。http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx