Javascript alert() when deleting rec with gridview

Discussion in 'ASP .Net' started by loga123, May 26, 2006.

  1. loga123

    loga123 Guest

    I am using a gridview with ASP 2.0 and VB.Net 2005. I would like to be
    able to pop-up a javascript alert('Are you sure') confirmation when the
    user clicks the 'Delete link' without adding an additional column for
    this, but I cannot figure out how. Can someone help? Thanks.
     
    loga123, May 26, 2006
    #1
    1. Advertising

  2. loga123

    Jimi200478 Guest

    you will have to point the "delete link" to a javascript function.
    inside that javascript function, add the confirmation. you will have to
    create a processing page to perform the delete, but this will give you
    the desired result.

    function ShowConfirmProcessing(url)
    {
    var result = confirm("You have selected items for
    processing. This cannot be undone. Are you sure that you want to
    proceed?")
    if(result == true)
    {
    location.href = url;
    }
    else
    {
    alert('No accounts have been processed');
    }
    }
     
    Jimi200478, May 26, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam Knight

    Datagrid Rec Field Validator!!

    Adam Knight, Aug 2, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    496
    Peter Blum
    Aug 2, 2005
  2. Karl Hungus

    seeking rec for weblogic hosting

    Karl Hungus, Jun 23, 2004, in forum: Java
    Replies:
    1
    Views:
    344
    Roedy Green
    Jun 23, 2004
  3. Neville C. Dempsey
    Replies:
    0
    Views:
    371
    Neville C. Dempsey
    Jun 12, 2005
  4. Skip Montanaro
    Replies:
    1
    Views:
    397
    Bengt Richter
    Jun 26, 2005
  5. Replies:
    0
    Views:
    354
Loading...

Share This Page