Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NET
I want to delete the records on Button click on asp.net page via vb.net language
Posted 3 Apr '12 - 18:28


5 solutions

If you are looking for javascript confirm, try this
<asp:button id="btnSubmit" runat="server" text="Delete" onclientclick="return confirm('Do you want to delete this record?');" xmlns:asp="#unknown" />
  Permalink  
Hi ,
 <script type="text/javascript">
        function confirmation() {
            if (confirm('are you sure you want to delete ?')) {
            return true;
            }else{
            return false;
            }
        }
    </script> 
 
<asp:button id="Button1" runat="server" text="Button" xmlns:asp="#unknown">
OnClientClick="return confirmation();" onclick="Button1_Click"/></asp:button>
 
Best regards
M.Mitwalli
  Permalink  
Hi
 
use on button click
Response.Write("<script>return confirmation();" </script>");
 
Thanks
  Permalink  
That's very simple for populating confirmation box on button click:
 
<asp:button id="btnDelete" runat="server" text="Delete" onclientclick="return confirm('Do you want to delete this record?');" xmlns:asp="#unknown" />
 
The above code will return true on click of OK and false on click of Cancel
Thanks
  Permalink  
<script type="text/javascript">
        function confirmation() {
            if (confirm('are you sure you want to delete ?')) {
            return true;
            }else{
            return false;
            }
        }
    </script>
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 414
1 Arun Vasu 253
2 OriginalGriff 190
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid