Search code examples
c#asp.netgridviewdialogrowcommand

Confirmation box for LinkButton in Gridview before Rowcommand fires


I have a gridview, and a linkbutton on this gridview.

When linkbutton is clicked, rowCommand fires, however I want to ask user to comfirm the click with a comfirmation box,

  • if yes -> rowCommand fires,
  • if no-> nothing happens.

I couldn't find a way to it.


Solution

  • Add this as the LinkButton's OnClientClick property:

    OnClientClick="return confirm('Do you really want?');"