2
I’m using Asp.net MVC
In my layout I have a menu div
and I have the container div where my @RenderBody()
And downstairs I have a script that pays for my menu:
$(document).ready(function (e) {
$(".Menu").each(function (index, item) {
var url = $(item).data("url");
if (url && url.length > 0) {
$(item).load(url);
}
});
});
But when clicking on other pages, it is always calling this script
I thought that by using @RenderBody
he just gave a "refresh" just in the div that he is
@Renderbody is equivalent to PHP include. It’s just a way to reuse snippets of code. To update only a specific div it would be necessary to use Ajax
– Rafael Companhoni