Quick question guys, I have this on my view
<div class="product_list">
@Html.Action("GetProducts", "Products")
</div>
and the controller is simply
public ActionResult GetProducts(string country, string currency, int category){
var viewModel = new ProductsViewModel{
Products = _proxy.GetProducts(country, currency, category, page)};
return PartialView(viewModel);
}
Then the GetProducts View just renders each product in a foreach loop
I would like to prevent this to happen if JS is enabled and with JQuery call te service asynchronously. Something like
$(".product_list").SOMETHING(function(event) {
event.preventDefault();
...
});
How can I do this?
Try this instead :
Edit : As per @kooshka comment
When JS disabled :
When JS enabled than the script code should be :
Good Luck !!