Here is what I did
Put this line on PageLoad
  bntDelete.Attributes.Add("onclick",
"javascript:if(confirm('Are you sure you want to
delete this operation?')== false) return false;")
Private Sub bntDelete_Click(ByVal sender As
System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles
bntCancel.Click
      DELETE RECORD
    End Sub

--- Greg Ewing <[EMAIL PROTECTED]> wrote:

> No, if the person clicks yes the Button Click event
> will be sent to the server where you will need to
> process it and delete the record.� If they click
> cancel the click event will be cancelled and the
> user will stay on the current page.
> 
> Greg Ewing [MVP]
> www.citidc.com 
> 
> ----------------------------------------
>  From: Anna Leon <[EMAIL PROTECTED]>
> Sent: Tuesday, September 14, 2004 1:29 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [AspNetAnyQuestionIsOk] How to Confirm
> a Delete in an ASP.NET Datagrid 
> 
> After hitting yes, will the record be deleted then?
> 
> --- [EMAIL PROTECTED] wrote:
> 
> > Add this line of code after Page_Load sub in your
> > code behind, assuming that you named your delete
> > button "btnDelete".
> > 
> > btnDelete.Attributes.Add("onclick",
> > "javascript:if(confirm('Are you sure you want to
> > delete this item?')== false) return false;")
> > 
> > 
> > 
> > 
> > _____ 
> > 
> > 
> > Zehra Altug | Intranet Applications Developer |
> > Information Technology Group | Media General, Inc.
> |
> > Tel: (804) 649-6149
> > 
> > 
> > 
> > -----Original Message-----
> > From: sas0riza [ mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, September 14, 2004 4:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: [AspNetAnyQuestionIsOk] How to Confirm a
> > Delete in an ASP.NET
> > Datagrid
> > 
> > 
> > I would like to delete a record, but only after
> > confirmation.
> > 
> > I have this JS function:
> > 
> > 
> > function confirm_delete()
> > {
> > if (confirm("Are you sure you want to delete this
> > item?")==true)
> > return true;
> > else
> > return false;
> > }
> >  
> > 
> > 
> > How do I incorporate it into my code?
> > 
> > 
> > 
> > 
> > 
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > [Non-text portions of this message have been
> > removed]
> > 
> > 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> [Non-text portions of this message have been
> removed]
> 
> 



                
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to