thanks for so much effort but this works only for the first row..nothing happens if i click on anyother row delete button
EDIT:-
click is working now i think issue was that i was using button i changed it to input type=button and changed id=captcha to class=captcha
but now issue is that in controller when i have a simple model then it gets value fine for it(for eg if i use UserPackage model then it gets value fine)...but when i try to pass view model it show null for user,packages,transaction,userpackages
EDIT-2:-
your code works 100% fine i created a new model to get ll values from ajax to AjaxDeleteMethod but is there any way i can pass PendingPaymentApprovals model same one which i populating the table rows in the view?
public class PendingPaymentApprovalsModel
{
public User user { get; set; }
public UserPackage userPackage { get; set; }
public Transaction transaction { get; set; }
public Package package { get; set; }
}
and then access in AjaxDeleteMethod with transaction.transactionID,UserPackages.U_ID etc?
also package status is not showing correct value it shows true when it should be false and this remains the same whether checkbox value is checked or not but i think thats because its getting value from the model which is getting value from database and not
from the currently selected checkbox value
Member
5 Points
58 Posts
Re: how to send selected row data from view to controller using ajax
Sep 11, 2020 06:29 AM|Learner94|LINK
thanks for so much effort but this works only for the first row..nothing happens if i click on anyother row delete button
EDIT:-
click is working now i think issue was that i was using button i changed it to input type=button and changed id=captcha to class=captcha
but now issue is that in controller when i have a simple model then it gets value fine for it(for eg if i use UserPackage model then it gets value fine)...but when i try to pass view model it show null for user,packages,transaction,userpackages
EDIT-2:-
your code works 100% fine i created a new model to get ll values from ajax to AjaxDeleteMethod but is there any way i can pass PendingPaymentApprovals model same one which i populating the table rows in the view?
and then access in AjaxDeleteMethod with transaction.transactionID,UserPackages.U_ID etc?
also package status is not showing correct value it shows true when it should be false and this remains the same whether checkbox value is checked or not but i think thats because its getting value from the model which is getting value from database and not from the currently selected checkbox value