diff options
Diffstat (limited to 'dwalker.xyz/Pages')
| -rw-r--r-- | dwalker.xyz/Pages/Error.cshtml | 26 | ||||
| -rw-r--r-- | dwalker.xyz/Pages/Error.cshtml.cs | 20 | ||||
| -rw-r--r-- | dwalker.xyz/Pages/Index.cshtml | 11 | ||||
| -rw-r--r-- | dwalker.xyz/Pages/Index.cshtml.cs | 10 | ||||
| -rw-r--r-- | dwalker.xyz/Pages/Shared/_Layout.cshtml | 16 | ||||
| -rw-r--r-- | dwalker.xyz/Pages/_ViewImports.cshtml | 3 | ||||
| -rw-r--r-- | dwalker.xyz/Pages/_ViewStart.cshtml | 3 |
7 files changed, 89 insertions, 0 deletions
diff --git a/dwalker.xyz/Pages/Error.cshtml b/dwalker.xyz/Pages/Error.cshtml new file mode 100644 index 0000000..6f92b95 --- /dev/null +++ b/dwalker.xyz/Pages/Error.cshtml @@ -0,0 +1,26 @@ +@page +@model ErrorModel +@{ + ViewData["Title"] = "Error"; +} + +<h1 class="text-danger">Error.</h1> +<h2 class="text-danger">An error occurred while processing your request.</h2> + +@if (Model.ShowRequestId) +{ + <p> + <strong>Request ID:</strong> <code>@Model.RequestId</code> + </p> +} + +<h3>Development Mode</h3> +<p> + Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred. +</p> +<p> + <strong>The Development environment shouldn't be enabled for deployed applications.</strong> + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> + and restarting the app. +</p> diff --git a/dwalker.xyz/Pages/Error.cshtml.cs b/dwalker.xyz/Pages/Error.cshtml.cs new file mode 100644 index 0000000..b7e3274 --- /dev/null +++ b/dwalker.xyz/Pages/Error.cshtml.cs @@ -0,0 +1,20 @@ +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace dwalker.xyz.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); + + public void OnGet() + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } +} + diff --git a/dwalker.xyz/Pages/Index.cshtml b/dwalker.xyz/Pages/Index.cshtml new file mode 100644 index 0000000..0283f0d --- /dev/null +++ b/dwalker.xyz/Pages/Index.cshtml @@ -0,0 +1,11 @@ +@page +@model IndexModel +@{ + ViewData["Title"] = "dwalker.xyz"; +} + +<section class="hero"> + <p class="eyebrow">.NET 10 Razor Pages</p> + <h1>Blank, modern, and ready.</h1> + <p class="lede">A minimal starting point for building dwalker.xyz without demo content or extra scaffolding.</p> +</section> diff --git a/dwalker.xyz/Pages/Index.cshtml.cs b/dwalker.xyz/Pages/Index.cshtml.cs new file mode 100644 index 0000000..69ef63d --- /dev/null +++ b/dwalker.xyz/Pages/Index.cshtml.cs @@ -0,0 +1,10 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace dwalker.xyz.Pages; + +public class IndexModel : PageModel +{ + public void OnGet() + { + } +} diff --git a/dwalker.xyz/Pages/Shared/_Layout.cshtml b/dwalker.xyz/Pages/Shared/_Layout.cshtml new file mode 100644 index 0000000..52b617a --- /dev/null +++ b/dwalker.xyz/Pages/Shared/_Layout.cshtml @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>@ViewData["Title"]</title> + <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> +</head> +<body> + <main class="app-shell"> + @RenderBody() + </main> + + @await RenderSectionAsync("Scripts", required: false) +</body> +</html> diff --git a/dwalker.xyz/Pages/_ViewImports.cshtml b/dwalker.xyz/Pages/_ViewImports.cshtml new file mode 100644 index 0000000..874bfd3 --- /dev/null +++ b/dwalker.xyz/Pages/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using dwalker.xyz +@namespace dwalker.xyz.Pages +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/dwalker.xyz/Pages/_ViewStart.cshtml b/dwalker.xyz/Pages/_ViewStart.cshtml new file mode 100644 index 0000000..a5f1004 --- /dev/null +++ b/dwalker.xyz/Pages/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} |
