Click here to Skip to main content
13,045,417 members (125,039 online)
Rate this:
Please Sign up or sign in to vote.
See more:
The delete button in gridview is automatically generated...
I want to ask the user for confirmation.....
I would like to use AJAX confirm button extender if possible....
The gridview is dynamically bound...
This means it does not have static columns..
Posted 8-Feb-13 20:32pm
Updated 8-Feb-13 20:41pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try THis :

 <asp:templatefield headertext="Action" >
       <asp:linkbutton id="btnDelete" text="Delete" runat="server" commandname="Delete" onclientclick="<%# "return confirm(\"do you want to delete " + Eval("name") + "\")" %>"> </asp:linkbutton>

if you to display the name of user or else so you write Eval("name"). here "name" is the field from your db.

if any thing else you want so, please post it.

Member 9644631 9-Feb-13 2:57am
This button is not showing in my gridview..
Do i need to add anything in codebehind..
Mits Machhi 11-Feb-13 6:56am
you have solved the problem or not
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

                           <asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/images/del3.png" ToolTip="Cancel"  />
                            &nbsp;<span onclick="return confirm('Are you sure to Delete the Row?')">
                           <asp:ImageButton ID="imgbtnDelete" CommandName="Delete" Text="Delete" runat="server" ImageUrl="~/images/del2.png" ToolTip="Delete" Visible="False" /></span>
                           <HeaderStyle BorderStyle="None" Width="40px" />
                                  <ItemStyle Width="50px" />

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 9 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100