From 9383a2fb09ffb60cfe63683106945bd688affa59 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Wed, 1 Jun 2022 21:13:43 +0200 Subject: feat: Initial commit after clean slate --- src/Pages/Errors/Index.cshtml.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Pages/Errors/Index.cshtml.cs (limited to 'src/Pages/Errors/Index.cshtml.cs') diff --git a/src/Pages/Errors/Index.cshtml.cs b/src/Pages/Errors/Index.cshtml.cs new file mode 100644 index 0000000..05e405d --- /dev/null +++ b/src/Pages/Errors/Index.cshtml.cs @@ -0,0 +1,19 @@ +using System; +using System.Net; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace VSH.Pages.Errors; + +public class Index : PageModel +{ + public HttpStatusCode ErrorStatusCode { get; set; } + + public void OnGet() { + try { + if (int.TryParse(RouteData.Values["code"]?.ToString(), out var status)) + ErrorStatusCode = (HttpStatusCode)status; + } catch (Exception e) { + Console.WriteLine(e); + } + } +} \ No newline at end of file -- cgit v1.3