Exemple #1
0
        private ViewResult ErrorView(HttpStatusCode code = HttpStatusCode.BadRequest, bool showFully = false)
        {
            ErrorMessageModel model;

            if (TempData.ContainsKey(ErrorMessageModel.ErrorMessageKey))
            {
                model = TempData[ErrorMessageModel.ErrorMessageKey] as ErrorMessageModel;
            }
            else
            {
                model = new ErrorMessageModel(showFully);
            }
            if (model.ResponseCode == HttpStatusCode.BadRequest)
            {
                model.ResponseCode = code;
            }
            return(View(SharedErrorViewName, model));
        }
Exemple #2
0
 /// <summary>
 /// Redirects to \Error
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 protected virtual ViewResult ErrorView(ErrorMessageModel model)
 {
     return(View("Error", model));
 }