I'm developing a site in ASP.NET MVC, I wanted it to change when my screen was refreshed, so my div .ESTRUTURA
is the code:
Javascript:
function loadPage(page) {
$.ajax({
type: 'GET',
url: page,
dataType: 'html',
cache: true,
async: true,
success: function (data) {
console.log($('.ESTRUTURA').html(data));
$('.ESTRUTURA').html(data);
}
});
}
HTML (In this case, it's own _Layout.cshtml)
<body>
<div class="bg">
@Html.Partial("_Header")
<div class="ESTRUTURA">
@RenderBody()
</div>
@Html.Partial("_Footer")
</div>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/vendors/underscore.js"></script>
<script src="~/Scripts/vendors/backbone.js"></script>
<script src="~/Scripts/app.js"></script>
</body>
Within my DIV .ESTRUTURA
has @RenderBody()
, I believe the problem is there. The variable data
, receives the entire HTML of the page (but should not).