CodeKicks.com
Focus on Microsoft Technologies - Tutorials, Articles, Code Samples.

Monday, September 25, 2006

Add Delete Confirmation To Gridview

Description: Add Delete Confirmation To Gridview

<asp:GridView ID="GridView1" runat="server" DataKeyNames="id" 
DataSourceID="SqlDataSource1">
<Columns>
   ...
   <asp:TemplateField ShowHeader="False">
     <ItemTemplate>
       <asp:LinkButton ID="LinkButton1" runat="server" 
CausesValidation="False"
CommandName="Delete"
                    OnClientClick='return confirm("Are you 
sure you want to delete this entry?");'
                    Text="Delete" />
     </ItemTemplate>
   </asp:TemplateField>
</Columns>
</asp:GridView>

Post a Comment