示例#1
0
        public ActionResult Error()
        {
            var errType = Request.QueryString["err"];

            var blogErrorViewModel = new BlogErrorViewModel { Title = SettingsRepository.BlogName,
                                                              ErrorCode = errType,
                                                              ErrorDescription = "An unknown error has occurred" };
            if (!string.IsNullOrEmpty(errType))
            {
                switch (errType)
                {
                    case "unauthorized":
                        blogErrorViewModel.ErrorDescription = "An unauthorized access was detected";
                        break;
                    case "invalid-month":
                        blogErrorViewModel.ErrorDescription = "Month/year in the url is invalid";
                        break;
                    default:
                        blogErrorViewModel.ErrorDescription = "An unknown error has occurred";
                        break;
                }
            }
            return View("Error", blogErrorViewModel);
        }
示例#2
0
        public ActionResult Error()
        {
            var errType = Request.QueryString["err"];

            var blogErrorViewModel = new BlogErrorViewModel
            {
                Title = SettingsRepository.BlogName,
                ErrorCode = errType,
                ErrorDescription = "An unknown error has occurred"
            };

            return View(blogErrorViewModel);
        }