Custom Deletion in ASP.NET Dynamic Data scaffolds

How can I implement a custom delete operation in ASP.NET Dynamic Data Project? I found this post but nothing helped. Here's the code block for delete command:

enter image description here

If I injected an event GridView1_RowCommand, I can catch it in the debugger, but where is the actual command code stored Delete, and if I changed the set_name to newDeletehow to implement a custom delete request?

+3
source share
1 answer

You can use the event RowCommandfor gridview and write your own code to delete

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName == "newDelete ")
    {
      e.CommandArgument // will Return current Row primary key value
        ..............
      //Write Delete custom code here
      .............
    }
}
+1
source

All Articles