/
Hello.cshtml
36 lines (31 loc) · 1.01 KB
/
Hello.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@page
@model AdminHelloDemoModel
@using Microsoft.AspNetCore.Mvc.RazorPages
@functions
{
public class AdminHelloDemoModel : PageModel
{
public string Title { get; set; }
public string Message { get; private set; }
public void OnGet()
{
Title = "This is an Admin RazorPage coming from OrchardCore.Demo!";
Message = $"Date and time on the server: { DateTime.Now.ToString() }";
}
}
}
@await Html.PartialAsync("Header", Model)
<zone Name="Title"><h1>@Model.Title</h1></zone>
<h2>Hello from @ViewContext.RouteData.Values["page"]</h2>
<p>
My model is not decorated with the '[Admin]' attribute but I am a protected Admin Page as I am under an '/Admin/' folder.
</p>
<p>
Being an Admin Page my default path based route is automatically prefixed with the current 'AdminOptions.AdminUrlPrefix'.
</p>
<p>
@Model.Message
</p>
<p>
Date using the DateTimeShape: @await DisplayAsync(await New.DateTime(Utc: null, Format: T["MMMM dd, yyyy"].Value))
</p>