I made a website that should work with the following setting.
NavBar at the top, this is ok.
Below it I have a container div, it is divided into two parts, the left part is a list of, can be called tags, the left side that is where the site will even happen is the forms part and such.
So let's go. This is my _Layout.cshtml:
<div class="container">
<div class="row">
<div class="col-md-3">
@Html.Partial("tags")
</div>
<div class="col-md-9">
@RenderBody()
<footer>
...
</footer>
</div>
</div>
</div>
When I run the URL:
localhost:8080/aplicacao/produtos
The @RenderBody()
shows the view Index.cshtml
of product where it lists the products, it receives the model that is nothing more than a result of the EF.
Regardless of what @RenderBody()
has @Html.Partial("tags")
has to appear on the side, but its content is always changing, and important to say, it does not change based on RenderBody()
view.
So let's imagine that I now change to addresses, then cars, etc ... The tags should continue to appear.
I have done all this for JavaScript, in the tags view I have a javascrip that arrives another URL (of tags), and loads the page with the result.
I did not like this solution, but I do not know how I would do otherwise.
Does anyone have a better solution?