I need to change the page URL according to PartialView that I upload via Ajax.
@EDIT
In addition, I also need to release the direct access to PartialView via URL, but, bringing the "parent" page with me because I work with it so that it performs functions of MasterPage, that is, load in it scripts and layout. I wanted to avoid importing my scripts on every page.
Resolved by adding $ ('# rodape'). load ('/ Web / Rodape'); to render a PartialView as a footer
I have the following code in my View
<div class="conteudo">
<!-- Conteudo regular do site -->
</div>
<div id="corpoConteudo"></div>
via Ajax, I load the contents of PartialView
into <div id="corpoConteudo">
My script is this
function Open(url) {
Carregar();
url = '@Url.Content("~/")' + url;
$.ajax({
url: url,
type: 'GET',
success: function (response) {
$('#corpoConteudo').html(response);
$('#loader').remove();
},
error: function () {
alert('Ocorreu um erro!');
$('#loader').remove();
}
});
}
function Carregar() {
$('#corpoConteudo').append('<div id="loader"></div>');
}