I want to delete a record from table and I have to send the ID of that record to the modal, how I do this?
main View :
<tbody>
@foreach (var item in Model)
{
<tr>
<td> @rowCount</td>
<td>@item.CategoryTitle</td>
<td>@item.IconCategory</td>
<td>
<a data-toggle="modal" data-target="#Deletemodal" asp-route-
category="@item.CategoryId" title="delete" class="btn btn-danger btn-
xs">delete</a>
</td>
</tr>
}
</tbody>
Partial view as a Modal:
@await Html.PartialAsync("_CreateMainCategory")
can u help me with code? I'm not good in ajaxHi @AliKhansari, you can check the sample code that I shared.