4
I made a website that should work with the following configuration.
Navbar on top, that’s okay.
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 which is where the site will even happen is the forms part and such.
So come on. 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
product where it lists the products, it gets the model that is nothing more than an EF result.
Regardless of what the @RenderBody()
present the @Html.Partial("tags")
it has to appear on the side, only that its content is always changing, and important to say, it does not change based on the view of RenderBody()
nay.
So let’s imagine that now I switch to addresses, then cars, etc... Tags should continue to appear.
I did all this by Javascript, in the tag view I have a javascrip that arrives another URL (tags), and loads the page with the result.
I didn’t like this solution, but I don’t know how else to do it.
Someone has a better solution?