using Business.Configuration; using Common.Helper; using Common.Model; using Newtonsoft.Json; using Repository.DAO.Account; using System; using System.Web; using System.Web.Optimization; using System.Web.Routing; namespace JMEAgentSystem { public class Global : HttpApplication { private void Application_Start(object sender, EventArgs e) { // Code that runs on application startup RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var container = AutoFacContainer.DIContainer(); AutoFacContainer.DIContainer(); } protected void Application_Error(object sender, EventArgs e) { //return; HttpException err = Server.GetLastError() as HttpException; DbResponse dr = new DbResponse(); if (err != null) { var page = HttpContext.Current.Request.Url.ToString(); dr = new AccountRepo().LogError(err, page, GetStatic.GetUser()); } Server.ClearError(); var url = GetStatic.GetVirtualDirName() + "/WebPages/Error"; ResponseWithUrl res = new ResponseWithUrl() { Id = dr.Id, Msg = dr.Msg, ResponseCode = dr.ResponseCode, Url = url }; Response.ContentType = "text/plain"; string json = JsonConvert.SerializeObject(res); Response.Write(json); Response.End(); ////Response.Redirect(url + "?id=" + dr.Id); //Server.Transfer(url + "?id=" + dr.Id); } } }