Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 19:28pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi
 
use on button click
Response.Write("<script>return confirmation();" </script>");
 
Thanks
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

<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
0 OriginalGriff 406
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 205
3 /\jmot 175
4 Shweta N Mishra 161
0 OriginalGriff 8,289
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,624
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 21 Dec 2012
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