コード例 #1
0
 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);
     }
 }
コード例 #2
0
 public ActionResult Index()
 {
     var model = new LayoutViewModel();
     return View(model);
 }
コード例 #3
0
 public ActionResult Register()
 {
     var model = new LayoutViewModel<User>();
     model.Model = new User();
     return View(model);
 }
コード例 #4
0
 public ActionResult Index()
 {
     var model = new LayoutViewModel();
     model.Title = "Admin Home";
     return AreaView("home/index",model);
 }
コード例 #5
0
 public ActionResult RegisterCompleted()
 {
     var model = new LayoutViewModel<User>();
     var service = Ioc.Get<IUserService>();
     model.Model = service.Get(GetUserId());
     return AreaView("account/RegisterStep2.cshtml", model);
 }
コード例 #6
0
 public ActionResult Register()
 {
     var model = new LayoutViewModel();
     return AreaView("account/registerStep1.cshtml", model);
 }
コード例 #7
0
 public ActionResult Login(string returnUrl)
 {
     var model = new LayoutViewModel<string>();
     model.Model = returnUrl;
     return AreaView("account/login.cshtml", model);
 }
コード例 #8
0
 public ActionResult Index()
 {
     var model = new LayoutViewModel();
     return AreaView("home/index.cshtml", model);
 }