protected override void OnException(ExceptionContext filterContext) { filterContext.ExceptionHandled = true; string error; if (filterContext.Exception is KnownException) { error = filterContext.Exception.Message; } else { if (Request.QueryString["debug"] == SettingContext.Instance.DebugKey) { error = filterContext.Exception.GetAllMessages(); } else { error = "服务器未知错误,请重试。如果该问题一直存在,请联系管理员。感谢您的支持。"; } } if (Request.QueryString["ajax"] == "true") { var result = new StandardJsonResult(); result.Fail(error); filterContext.Result = result; } else { var model = new LayoutViewModel(); model.Error = error; filterContext.Result = this.View(this.GetErrorViewPath(), model); } }
public ActionResult Index() { var model = new LayoutViewModel(); return View(model); }
public ActionResult Register() { var model = new LayoutViewModel<User>(); model.Model = new User(); return View(model); }
public ActionResult Index() { var model = new LayoutViewModel(); model.Title = "Admin Home"; return AreaView("home/index",model); }
public ActionResult RegisterCompleted() { var model = new LayoutViewModel<User>(); var service = Ioc.Get<IUserService>(); model.Model = service.Get(GetUserId()); return AreaView("account/RegisterStep2.cshtml", model); }
public ActionResult Register() { var model = new LayoutViewModel(); return AreaView("account/registerStep1.cshtml", model); }
public ActionResult Login(string returnUrl) { var model = new LayoutViewModel<string>(); model.Model = returnUrl; return AreaView("account/login.cshtml", model); }
public ActionResult Index() { var model = new LayoutViewModel(); return AreaView("home/index.cshtml", model); }