This question is locked. New answers and comments are not allowed.
A have the following MVC grid:
@(
Html.Telerik().Grid<QMS.Models.CustomerTableRow>(Model)
.Name("CustomerTable")
.Columns(c =>
{
c.Template(
@<text>
@Ajax.ActionLink("Delete","Delete", new { key = item.CustomerKey },new AjaxOptions{ Confirm="Delete this Customer?",UpdateTargetId = "CustomerTable", HttpMethod = "Delete"})
</text>
);
c.Bound(col => col.FirstName);
c.Bound(col => col.LastName);
c.Bound(col => col.Email);
c.Bound(col => col.HomePhone);
})
.Pageable()
.Sortable()
.Resizable(res => res.Columns(true))
.Scrollable()
)
//Action Method in view
//[HttpDelete] <-- can't have this or else a "Resource not found" error occurs
public ActionResult Delete(String key)
{
repo.DeleteCustomer(key);
return PartialView("CustomerTable", repo.GetCustomerTable());
}
Some odd things happen when I click on the "Delete" link that I create in the template column. First, the confirmation message does not appear but the delete action is still called. Second, even though I have HttpMethod="Delete", If I decorate the action method with [HttpDelete] I get a "resource not found" error. Finally, this grid is in a partial view and the action method returns the partialview after the delete however all formatting is lost, it's as if the CSS file is no longer there. None of this happens if the link is rendered outside of the grid. I am using version 2011.1.315
@(
Html.Telerik().Grid<QMS.Models.CustomerTableRow>(Model)
.Name("CustomerTable")
.Columns(c =>
{
c.Template(
@<text>
@Ajax.ActionLink("Delete","Delete", new { key = item.CustomerKey },new AjaxOptions{ Confirm="Delete this Customer?",UpdateTargetId = "CustomerTable", HttpMethod = "Delete"})
</text>
);
c.Bound(col => col.FirstName);
c.Bound(col => col.LastName);
c.Bound(col => col.Email);
c.Bound(col => col.HomePhone);
})
.Pageable()
.Sortable()
.Resizable(res => res.Columns(true))
.Scrollable()
)
//Action Method in view
//[HttpDelete] <-- can't have this or else a "Resource not found" error occurs
public ActionResult Delete(String key)
{
repo.DeleteCustomer(key);
return PartialView("CustomerTable", repo.GetCustomerTable());
}
Some odd things happen when I click on the "Delete" link that I create in the template column. First, the confirmation message does not appear but the delete action is still called. Second, even though I have HttpMethod="Delete", If I decorate the action method with [HttpDelete] I get a "resource not found" error. Finally, this grid is in a partial view and the action method returns the partialview after the delete however all formatting is lost, it's as if the CSS file is no longer there. None of this happens if the link is rendered outside of the grid. I am using version 2011.1.315