Button1 ID="btndel" Text="Delete" runat="server" CommandName="btnDelete" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
OnClientClick="javascript : return confirm('Do you want to delete?');"
asp:TemplateField
------- CSharp ----------
protected void gdv_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "Page")
return;
GridView gv = (GridView)sender;
Int32 rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
GridViewRow currentRow = gv.Rows[rowIndex];
hdnHolidayId.Value = (Label)currentRow.FindControl("lblHolidayId"))).Text;
}
}