I would give all the <a>
elements a class, say getProducts
, and then bind a click event to them:
(Forgive me for writing the url in the <%
syntax)
So for the <a>
elements:
<a href="javascript:void(0);" class="getProducts">@tree.CategoryName</a>
And for the click event binding:
$('.getProducts').on('click', function() {
$('#productsPlace').load('<%=Url.Action("GetProducts", "YourController")%>', new { catID = tree.CategoryCode,langID= 1}, null);
});