summaryrefslogtreecommitdiff
path: root/Pages/Error.cshtml.cs
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2024-03-21 14:54:11 +0000
committerIan C <ianc@noddybox.co.uk>2024-03-21 14:54:11 +0000
commit9764af998a4c91196687b8d27693b935a243ab84 (patch)
treed5f4bf49be0db32f8cfc78a4d76df82be14a2060 /Pages/Error.cshtml.cs
Initial checkin following project regeneration to make post work
Diffstat (limited to 'Pages/Error.cshtml.cs')
-rw-r--r--Pages/Error.cshtml.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Pages/Error.cshtml.cs b/Pages/Error.cshtml.cs
new file mode 100644
index 0000000..c47665b
--- /dev/null
+++ b/Pages/Error.cshtml.cs
@@ -0,0 +1,27 @@
+using System.Diagnostics;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace download_admin.Pages;
+
+[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+[IgnoreAntiforgeryToken]
+public class ErrorModel : PageModel
+{
+ public string? RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ private readonly ILogger<ErrorModel> _logger;
+
+ public ErrorModel(ILogger<ErrorModel> logger)
+ {
+ _logger = logger;
+ }
+
+ public void OnGet()
+ {
+ RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
+ }
+}
+