How do I delete a row by just passing the id using a jquery ajax call on a link button?
$(document).ready(function(){
$(".remove_row").click(function (event){
event.preventDefault();
var url = $(this).attr('href');
$.ajax({
url: url,
success: function() { return false; },
error: function(){ alert('An error.'); }
});
return false;
);
});
do I need to mention the dataType: and write success function .. when I want to just delete the row?
your question is not clear, assuming these possible cases:
you want to remove any element on your page
you want to remove a row from a databound list or table i.e. you want to remove row from your database:
in this case you will need to call server side static method and pass the id of the row to be deleted which can be done as shown below:
and your ServerSideMethod on WebForm1.aspx should be like this: