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 18:28pm
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  
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  

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

  Print Answers RSS
0 OriginalGriff 330
1 Nirav Prabtani 242
2 Richard Deeming 240
3 CHill60 170
4 _Amy 145
0 OriginalGriff 8,104
1 Sergey Alexandrovich Kryukov 7,045
2 Maciej Los 4,039
3 Peter Leow 3,738
4 CHill60 2,912


Advertise | Privacy | Mobile
Web02 | 2.8.140721.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