Unable to add HTML.BeginForm inside ASP.NET WebGrid

48 views Asked by At

I have the following code inside my asp.net MVC-4 razor view:-

gridcolumns.Add(new WebGridColumn()
    {
        CanSort = false,
        Format =
         (item) =>
         {
             var banner = item.Value as Sales.Models.DeleteAllRequest;
             if (!banner.Approved)
             {
                 return Html.ActionLink("Approve", "DeleteRequestDeleteAll", "Customer", new { customerid = banner.CustomerID, requestid = banner.ID },
new AjaxOptions
{
    Confirm = "Are You sure You want to delete (" + banner.CustomerName.ToString() + ")",
    OnSuccess = "deletionconfirmation",
    OnFailure = "deletionerror"
});
             }
             return "";

         }

    });

The above code will add <a> link inside the ASP.NET web grid column. but since i am doing a Delete action so i should be sending Post request instead of Get request. so i am not sure how i can use Html.BeginForm instead of Html.ActionLink inside my above code?

Thanks

0

There are 0 answers