I have created on controller like this
public ActionResult DeleteRecordFunction(int charityID)
{
try
{
//Call your delete function to delete record
objEntities.Delete(charityID);
ViewData["deletetatus"] = "1";
}
catch
{
ViewData["deletetatus"] = "0";
}
return RedirectToAction("/CharityList/");
}
and my view is
<div align="left" class="griddivshadow">
@grid.GetHtml(
tableStyle: "webgrid",
alternatingRowStyle: "alternative-row",
rowStyle: "gridrow",
headerStyle: "",
footerStyle: "foot-grid",
mode: WebGridPagerModes.All,
firstText: "<< First",
previousText: "< Previous", nextText: "Next >",
lastText: "Last >>",
columns: new[] {
grid.Column("PCharityNumber","" ,canSort: true,style: "id"),
grid.Column("PCharityName","",canSort: true,style: "name"),
grid.Column("PState","",canSort: true,style: "state"),
grid.Column("",
header: "___Edit",
style:"grid-header",
format: @<text>  <a href="@Url.Action("AddCharity", "CharityView", new { charityID = Model.PCharityId })" >
<img width="15px" alt="" height="15px" src="../../Content/Images/Editfor.jpg" /><span
style="font-family: Verdana; font-size: small;">Edit</span></a>
</text>
),
grid.Column("",
header: "___Delete",
style:"grid-header",
format: @<text>   <a href="@Url.Action("CharityList", "PledgeNet", new { charityID = Model.PCharityId })" >
<img id="a" width="15px" alt="" height="15px" src="../../Content/Images/cross.png" /><span
style="font-family: Verdana; font-size: small;">Delete</span></a>
</text>
)
})
</div>
but my webgrid edit or delete ids are not passed to controller
so please resolve this