From 342706107f09243ae800ac31f7e22774e85f5241 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 11 Jun 2018 09:39:52 -0700 Subject: [PATCH] ResponseCache attribute on RazorPages Error handler method should be moved to model Fixes dotnet/aspnetcore#553 Commit migrated from dotnet/aspnetcore@e403187be35a --- .../content/Angular-CSharp/Pages/Error.cshtml.cs | 2 +- .../content/React-CSharp/Pages/Error.cshtml.cs | 2 +- .../content/ReactRedux-CSharp/Pages/Error.cshtml.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Pages/Error.cshtml.cs b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Pages/Error.cshtml.cs index d3ef08b..9cb1d63 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Pages/Error.cshtml.cs +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Pages/Error.cshtml.cs @@ -8,13 +8,13 @@ using Microsoft.AspNetCore.Mvc.RazorPages; namespace Company.WebApplication1.Pages { + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public class ErrorModel : PageModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public void OnGet() { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Pages/Error.cshtml.cs b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Pages/Error.cshtml.cs index d3ef08b..9cb1d63 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Pages/Error.cshtml.cs +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Pages/Error.cshtml.cs @@ -8,13 +8,13 @@ using Microsoft.AspNetCore.Mvc.RazorPages; namespace Company.WebApplication1.Pages { + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public class ErrorModel : PageModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public void OnGet() { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Pages/Error.cshtml.cs b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Pages/Error.cshtml.cs index d3ef08b..9cb1d63 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Pages/Error.cshtml.cs +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Pages/Error.cshtml.cs @@ -8,13 +8,13 @@ using Microsoft.AspNetCore.Mvc.RazorPages; namespace Company.WebApplication1.Pages { + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public class ErrorModel : PageModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public void OnGet() { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;