Click here to Skip to main content
12,451,425 members (49,685 online)
Rate this:
 
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 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"/>

Best regards
M.Mitwalli
  Permalink  
Comments
Hareesh Malli 23-Dec-14 6:27am
   
Best answer buddy. You just make it simple and saved my lot of time. Thanks
Mohamed Mitwalli 24-Dec-14 0:20am
   
Thanks Hareesh :)
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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2016
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