From df4db2f49c80ef310067af0808b04b0acf87e148 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 22 Jan 2018 14:44:44 -0800 Subject: [PATCH] Fix manage views layout --- .../Areas/Identity/Pages/Account/Manage/_Layout.cshtml | 9 ++++++++- .../Identity/Pages/Account/Manage/_ViewStart.cshtml | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/UI/Areas/Identity/Pages/Account/Manage/_ViewStart.cshtml diff --git a/src/UI/Areas/Identity/Pages/Account/Manage/_Layout.cshtml b/src/UI/Areas/Identity/Pages/Account/Manage/_Layout.cshtml index f8728b543f..34b7c17840 100644 --- a/src/UI/Areas/Identity/Pages/Account/Manage/_Layout.cshtml +++ b/src/UI/Areas/Identity/Pages/Account/Manage/_Layout.cshtml @@ -1,5 +1,12 @@ @{ - Layout = "/Areas/Identity/Pages/_Layout.cshtml"; + if (ViewData.TryGetValue("ParentLayout", out var parentLayout)) + { + Layout = (string)parentLayout; + } + else + { + Layout = "/Areas/Identity/Pages/_Layout.cshtml"; + } }

Manage your account

diff --git a/src/UI/Areas/Identity/Pages/Account/Manage/_ViewStart.cshtml b/src/UI/Areas/Identity/Pages/Account/Manage/_ViewStart.cshtml new file mode 100644 index 0000000000..4afb326bcc --- /dev/null +++ b/src/UI/Areas/Identity/Pages/Account/Manage/_ViewStart.cshtml @@ -0,0 +1,7 @@ +@{ + if (Layout != "_Layout") + { + ViewData["ParentLayout"] = Layout; + Layout = "./_Layout.cshtml"; + } +} \ No newline at end of file