Dr.Ajay Kashyap

Dr.Ajay Kashyap

  • NA
  • 521
  • 278k

Jquery live() method Not Working In ASP.net MVC

Feb 3 2017 3:08 AM
Hello.... 
Anyone can help..
live() method Not Working i am Using jquery-1.10.2.min.js. and .live() method Not Working 1.9 Onword Version..  so How To Write This Function Now  
 
$('a.remove').live("click", function (e) {
e.preventDefault();
$(this).parent().parent().remove();
});
 
<table id="dataTable" border="0" cellpadding="0" cellspacing="0">
<tr>
<th>Category</th>
<th></th>
</tr>
@if (Model != null && Model.Count > 0)
{
int j = 0;
foreach (var i in Model)
{
<tr style="border:1px solid black">
<td>@Html.TextBoxFor(a => a[j].Category)</td>
<td>
@if (j > 0)
{
<a href="#" class="remove">Remove</a>
}
</td>
</tr>
j++;
}
}
</table>
$('a.remove').live("click", function (e) {
e.preventDefault();
$(this).parent().parent().remove();
});

Answers (2)