Use MVC5 and Visual Studio 2013. I created this route: Home/PaginaBase
. This route calls a new page, called PaginaBase
, which has header and footer similar to Index
. This footer creates a Menu. When I select an item from this menu, it calls me PaginaBase
, setting up the URL like this:
Until then, okay. When I select another item (I continue withinlink .
PaginaBase
), it keeps the same URL in the call and adds Home/PaginaBase/8/3
again, so there is a nonexistent route. How do I resolve this?
Below my jquery function
function MontaMenuInferior() {
var str = "";
$.ajax({
url: '/Home/MontaMenuInferior',
dataType: "json",
contentType: "application/json; charset=utf-8",
type: "POST",
success: function (data) {
$(data.resultado).each(function () {
str = str + '<ul class="grid_4">' +
'<li>' + this.SubCategoria + '</li>';
$(this.subconsulta).each(function () {
if (this.Id_SubCategoria2 != null)
str = str + '<li><a href="Home/PaginaBase/' + this.Id_SubCategoria2 + '/3" title="">' + this.SubCategoria2 + '</a></li>';
//str = str + '<li><a href="@Url.RouteUrl(PaginaBase"',new{ Parametro : this.Id_SubCategoria2, tipo : '3'} + ")">this.SubCategoria2 + '</a>'
else
str = str + '<li><a href="#' + this.SubCategoria2 + '" title="">' + this.SubCategoria2 + '</a></li>';
});
str = str + '</ul>';
$('#menufooter').append(str);
str = "";
});
},
error: function (error) {
}
});
}