you need to do like this
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="Button1" runat="server" CausesValidation="False" ImageUrl="~/script/delete.gif" CommandArgument='<%# eval("MyRowId") %>' CommandName="Select"
AlternateText="Delete"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string name = e.CommandName;
if(name=="delete")
{
}
GridView1.DataBind();
}