Display the one layout based if the user is logged ( a dummy login system) in or the other if not. (
So I would like to display one layout with multiple pages (and remove Index.cshtml) and the other if the user is not logged in. I tried many ways, but I simply cannot figure out how to do that.Program.cs
The Login.cshtml on the Layout 2
The Viewstart.cshtml
The index.csthml on the Layout 1 (This should be removed)
Another cshtml in the Layout 1 (Requires Login)
The Login function in the in login controller is the following:
6 Replies
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/ok. thanks
Ok, I now formatted the code to be more compliant to the rules
The errors I am currently getting are: A circular layout reference was detected when rendering '/Pages/Shared/_LoginLayout.cshtml'. The layout page '/Pages/Shared/_LoginLayout.cshtml' has already been rendered, page crashed and issues related to the absence of the @RenderBody tag or it just straight up crashes.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.Unfurtunately,no. I found a way to use one layout, but I still would like to use more layouts.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.
Was this issue resolved? If so, run /close
- otherwise I will mark this as stale and this post will be archived until there is new activity.