+ Request ID: @Model.RequestId
+
+ Swapping to the Development environment displays detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
diff --git a/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Pages/Error.cshtml.cs b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Pages/Error.cshtml.cs new file mode 100644 index 000000000000..05fff7b1109b --- /dev/null +++ b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Pages/Error.cshtml.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Diagnostics; + +namespace WebAll.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 ILoggerLearn about building Web apps with ASP.NET Core.
+RP: Use this page to detail your site's privacy policy.
diff --git a/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Pages/Privacy.cshtml.cs b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Pages/Privacy.cshtml.cs new file mode 100644 index 000000000000..edf4a9931c58 --- /dev/null +++ b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Pages/Privacy.cshtml.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace WebAll.Pages +{ + public class PrivacyModel : PageModel + { + private readonly ILoggerLearn about building Web apps with ASP.NET Core.
+MVC: Use this page to detail your site's privacy policy.
diff --git a/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Salary/Index.cshtml b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Salary/Index.cshtml new file mode 100644 index 000000000000..0e9885208534 --- /dev/null +++ b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Salary/Index.cshtml @@ -0,0 +1,6 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ +} +Salary view MVC controller \ No newline at end of file diff --git a/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/Error.cshtml b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/Error.cshtml new file mode 100644 index 000000000000..10cf32b713d0 --- /dev/null +++ b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/Error.cshtml @@ -0,0 +1,25 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +
+ Request ID: @Model?.RequestId
+
+ Swapping to Development environment will display more detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
diff --git a/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/_ValidationScriptsPartial.cshtml b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 000000000000..21638b60442a --- /dev/null +++ b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,2 @@ + + diff --git a/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/x_Layout.cshtml b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/x_Layout.cshtml new file mode 100644 index 000000000000..4591bca27d21 --- /dev/null +++ b/aspnetcore/security/authorization/claims/samples/7.x/WebAll/Views/Shared/x_Layout.cshtml @@ -0,0 +1,58 @@ + + + + + +