Witam,
mam taką metodę w Controllers
public ActionResult GetCartCount()
{
int caounofcart = shoppingCartManager.GetCartItemsCount();
return Json(new { name = caounofcart });
}
i chce tego jsona przypisać do zawartości elementu
próbuje tak ale to nie działa
$("#cartbox").text(updatecart);
function updatecart() {
$.getJSON("@Url.Action("GetCartCount", "Cart")", function (name) {
var textnowy = name[0];
$("#cartbox").text(textnowy);
return textnowy;
});
};
Jak sobie z tym poradzić?