Add this confirm() dialog onclientclick event of the asp.net button control or any other control if you are using such as asp.net image button control or Link button.
Here I am using asp.net button control for deleting records and add below line of code in template column of GridView in side a button control
OnClientClick="return confirm('Do you want to delete this record?');"
Your GridView code will look like this