Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax
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 21:32pm
Edited 8-Feb-13 21:41pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try THis :
 
 
 <asp:templatefield headertext="Action" >
 
      <itemtemplate>
       <asp:linkbutton id="btnDelete" text="Delete" runat="server" commandname="Delete" onclientclick="<%# "return confirm(\"do you want to delete " + Eval("name") + "\")" %>"> </asp:linkbutton>
       </itemtemplate>
</asp:templatefield>
 
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.
 

Mitesh
  Permalink  
v2
Comments
Member 9644631 at 9-Feb-13 2:57am
   
This button is not showing in my gridview..
Do i need to add anything in codebehind..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

<asp:TemplateField>
                          
                           <asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/images/del3.png" ToolTip="Cancel"  />
                               </EditItemTemplate>
                           <ItemTemplate>
                          
                            &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>
                           </ItemTemplate>
                           <HeaderStyle BorderStyle="None" Width="40px" />
                                  <ItemStyle Width="50px" />
                           </asp:TemplateField>
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 359
1 Maciej Los 290
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 185
4 PIEBALDconsult 149
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 9 Feb 2013
Copyright © CodeProject, 1999-2014
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