Hi,
Please modify your javascript function as follows :
function showPMuaHang(pid) {
var url = '/ShoppingCart/getDetailsProduct/' + pid;
$.ajax({
type: "POST",
url: url,
success: function (data) {
document.getElementById("popup_muahang").innerHTML = data.detPro;
}
})
}
problem is with url - your path is as follows -
/ShoppingCart/' + pid + '/getDetailsProduct'
where pid - 70
but you dont have 70 as your action or method.In URL '
getDetailsProduct
' is treated as " ID "
Following is the right format -
/ShoppingCart/getDetailsProduct/' + pid
which is -
/ShoppingCart/getDetailsProduct/70
It will goto ShoppingCartController and will serach for
getDetailsProduct
for the pid = 70