This question is locked. New answers and comments are not allowed.
I had a page that used a standard HTML table with a form for deleting a row (user) in one of the columns (a form in each row).
However, when I converted this page to use the Telerik MVC grid, the form doesn't seem to be rendering correctly. Is this because the grid renders it's own form and so my forms are now nested?
If so, how can I get around this. I need a button that will call an MVC action to delete a user (and display a javascript alert to confirm that this operation should really happen).
My current (non-working) code snippet is below:
columns.Template(
@<text>
@if (!item.Username.Equals("administrator", StringComparison.CurrentCultureIgnoreCase))
{
using (Html.BeginForm("Delete", null))
{
@Html.Hidden("id", item.Id)
<button type="submit" onclick="javascript:return confirm('You are about to delete a user!')">Delete</button>
}
}
else
{
<text> </text>
}
</text>)
However, when I converted this page to use the Telerik MVC grid, the form doesn't seem to be rendering correctly. Is this because the grid renders it's own form and so my forms are now nested?
If so, how can I get around this. I need a button that will call an MVC action to delete a user (and display a javascript alert to confirm that this operation should really happen).
My current (non-working) code snippet is below:
columns.Template(
@<text>
@if (!item.Username.Equals("administrator", StringComparison.CurrentCultureIgnoreCase))
{
using (Html.BeginForm("Delete", null))
{
@Html.Hidden("id", item.Id)
<button type="submit" onclick="javascript:return confirm('You are about to delete a user!')">Delete</button>
}
}
else
{
<text> </text>
}
</text>)