I was wondering how to make an ajax request separately inside the looping form, which able to send the async delete request when I click the specified row deleted button.
not sure how to allocate the identity when I click the button using jquery.
foreach(var item in Model){
<form>
<input type="text" id="id" name="id" value="item.id"/>
<input type="button" id="btn" name="submit" value="Delete"/>
</form>
}
<script>
$("#btn").click(function(){
// alert the id value
});
</script>
2
Answers
I have found the solution based on Agus Friasana method:
You can try with