My aplication have walls with notes. I wish to put on layout name of active wall. How to do that? I know that on front-end I can use just @Model... but who sends this model? Also better idea is store this information in session variable or create another property in user database?
EDIT: I use .NET Core 1.1.
If you are talking about the _Layout.cshtml then you could place the following in _Layout.cshtml:
@RenderSection("layoutName", required: false)
Any view which inherits this layout can now add code to this section.
SomeOtherView.cshtml:
@section layoutName{
<h1>@Model.LayoutName</h1>
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With