1

I would like to refresh the page when delete button is clicked in gridview, however I could not find a way to do it, if I write my onrowcommand function

if (e.CommandName == "Delete")
{
Response.Redirect("~/Order.aspx");
}

it does redirect first, and do not delete the record, however I want to be able to delete the record and refresh the page using redirect method afterwards.

HOY
  • 1,067
  • 10
  • 42
  • 85

1 Answers1

2

Don't use the delete command, but rather the RowDeleted server side event. It fires after the row is deleted and it serves your purpose.

Link to docs

Konstantin Dinev
  • 34,219
  • 14
  • 75
  • 100