REFRESH A PARTIAL VIEW WITHOUT LOADING THE WHOLE VIEW
hi,
well , i have an e-commerce app, when i click at "add to cart" button , i want that this article is added to cart without loading this page.
I know , i have to work with ajax, i did that, but when i click into the button , nothing appears in the cart, but when i load manually the view , i see the article added,
this is the structure of my app
1/_layout.cshtml : call 2 another views :
1-1/_cartshop.cshtml : contains the cart
1-2/index.chstml , contains the list of articles , also contains the ajax button
this is my method in homecontroller :
public PartialViewResult addtocart(int id)
{
// article added to the list
return PartialView("_cartshop");
}