Hi,
I have below code . Can delete part be called thry Partial View so i have to write it every Controller View. I want marked part to be called thru Partial View
@foreach (var item in Model.Locations)
{
@Html.DisplayFor(model => item.Id)
@Html.DisplayFor(model => item.Description)
@if(item.IsActive)
{
}
else
{
}
Edit
@if (item.IsActive)
{
data-target="#[email protected]" style='margin-left:5px'> Delete
}
else
{
Delete
}
@using (Html.BeginForm("DeleteLocation", "Location", new { id = item.Id }, FormMethod.Post, null))
{
@Html.AntiForgeryToken()
}
}
Thanks

Arnab MukherjeeRank #879 · 2.5K reputationPosted Jun 17, 2021, 6:41 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jun 17, 2021, 6:53 AM EDT
class
="modal-danger">Delete ConfirmationAre you sure you want to delete this record ?
Sachin SinghRank #66 · 26.2K reputationPosted Jun 17, 2021, 6:10 AM EDT
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 17, 2021, 6:31 AM EDT
Hi Sachin
Can u pls Help with Code.
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 17, 2021, 6:52 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jun 17, 2021, 8:53 AM EDT
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 17, 2021, 11:37 AM EDT