Hello every one,
I am working on mvc5 with visual studio 2015. I am using products.js file and called this products.js file on _Layout.cshtml page as shown below,
I have added this jquery code,
- passproductid = {
- passid: function () {
-
- $('.edit_product').on('click', function (e) {
- debugger;
- var _productId = $(this).attr('id');
- $.ajax({
- url: '/ProductCategory/GetProducts/',
- type: "POST",
- data: { productid: _productId.substring(10) },
- success: function (data) {
-
- $('#divresult').html(data);
- }
- });
- });
- }
- }
after I have called this jquery function throught table tr click to get row id like this,
- @foreach (var item in Model)
- {
- <tr id="[email protected]" onclick="return passproductid.passid()" class="edit_product">
but getting this error,
How can I solve this?