Let's suppose you want to give a warning information to the clients:
<asp:GridView ID="GridView1" DataKeyNames="ID" ...>
<Columns>
<asp:TemplateField HeaderText="ButtonColumn">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CommandName="Delete" OnclientClick="<%#Eval("Primary Key","return confirm('Are you sure to delete Record {0}?');")%>"/>
</ItemTemplate>
</asp:TempalteField>
</Columns>
</asp:GridView>

Example :
<asp:ImageButton ID="imgView" ImageUrl="../Images/view.jpg" runat="server"
OnClientClick='<%# Eval("Accname", "Openpopup(\"{0}\"); return false;") %>'>
</asp:ImageButton>


Comments (0)