Home          welcome : Guest          Log In      
  Xpode.com Beta version

Click here to Search Article

Categories/Articles

 

Ask Confirmation when delete the record

 

Submitted By:


Rohit kakria

Detail : I am working as software developer in a company. I love to enjoy life. I think "Life is that what we think".

Ask Confirmation when delete the record from grid view or data grid

There are many conditions where we want to confirm from user that he want to delete the record from database or not when user clicks on delete button in Grid view, datalist or datagrid. Then there is a way to do this with javascript. We will show a alert box.to user that if he clicks on Yes then record will delete, other wise not.

<asp:TemplateField>
<ItemTemplate>
<asp:LinkButtonID="LinkButton1"runat="server"
OnClientClick="return confirm('Are you sure to delete this record?');"
CommandName="Delete">Delete Comment</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
When user will click on the delete button then he will have to confirm the deletion.If he will click on yes button then the record will be deleted otherwise record will not be deleted.







Comments
Share this article   |    Print   
Guest      Thursday, January 21, 2010
FLzHO4  &lt;a href=&quothttp://rbykznvjywzr.com/&;quot;&gt;rbykznvjywzr&lt;/a&gt;, tfdhibbzuegf, [link=http://vdfgafscatrd.com/]vdfgafscatrd[/link], http://jvexjxxesvlj.com/
Guest      Thursday, January 21, 2010
FLzHO4  &lt;a href=&quothttp://rbykznvjywzr.com/&;quot;&gt;rbykznvjywzr&lt;/a&gt;, tfdhibbzuegf, [link=http://vdfgafscatrd.com/]vdfgafscatrd[/link], http://jvexjxxesvlj.com/
 
*  Name         *   Comments :ar 8) :cry: 8)
:shock: :shock: :evil: :!:
:( :idea: :lol: :x
:green: :| :question: :P
:oops: :roll: :) :o
:twisted: :wink:
*  Email          
                          (will not publish)
     
  Location           
  Website            
Enter the code *
(as shown below)