现在就是有个问题:因为我们项目的页面是用的Html标签所以用AjAx来提交表单但是我的Log4Net程序却无法捕获到类库中的错误(用服务器控件却可以捕获到这个错误!!),直接就跳到Js页面去了 压根就不进去到Application_Error方法里面去  
求解!!接下来我把代码贴上来请大家看看:
//这是报错的方法   
public static Gj.Common.ReturnValue Operator_LoginOrLogout(string strCode, string strPwd)
   { //错误地方
   int a = Convert.ToInt32("");
   Gj.Common.ReturnValue rt = dba.GetReturnValue("proc_Back_LoginOrLogout",
   new SqlParameter("@strCode", strCode),
   new SqlParameter("@strPwd", Gj.Encrypt.EncryptMD5(strPwd)));
   if (rt.result > 0)
   {
   Safe.P_SetCookie(rt.reason);
   }   return rt;
   }
//这是我写的捕获错误机制的代码 其他地方全部配好了没有问题
   public static void WriteLog(string info, Exception se)
   {
   if (MyLog.IsErrorEnabled)
   {
   MyLog.Error(info, se);
   }
   }
//下面调用这个方法来自动抓取错误然后写入到数据库
  protected void Application_Error(object sender, EventArgs e)
   {
   Exception objExp = HttpContext.Current.Server.GetLastError();
   LogHelper.WriteLog("\r\n客户机IP:" + Request.UserHostAddress + "\r\n错误地址:" + Request.Url + "\r\n异常信息:" + Server.GetLastError().Message, objExp);
   }