display message box in ASP.NET when delete command is fired

Discussion in 'ASP .Net Datagrid Control' started by Next, Nov 19, 2003.

  1. Next

    Next Guest

    I would like to display a message box that says;

    "You are about to delete this record. Is this what you want to do?"


    I want to do this when the delete command is fired.

    How do I do this?

    Any help is greatly appreciated!

    Aaron
    Next, Nov 19, 2003
    #1
    1. Advertising

  2. Next

    Alvin Bruney Guest

    Here is the code is use
    if((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType !=
    ListItemType.Footer))

    {

    LinkButton deleteButton = ((LinkButton)e.Item.Cells[2].Controls[0]);

    deleteButton.Attributes.Add("onClick", "event.returnValue=confirm('Are you
    sure you wish to delete this item?');");

    }


    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Next" <aeverettNO^*jg^_junk..com> wrote in message
    news:...
    > I would like to display a message box that says;
    >
    > "You are about to delete this record. Is this what you want to do?"
    >
    >
    > I want to do this when the delete command is fired.
    >
    > How do I do this?
    >
    > Any help is greatly appreciated!
    >
    > Aaron
    >
    >
    Alvin Bruney, Nov 19, 2003
    #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. Grey
    Replies:
    7
    Views:
    13,603
    Greg Burns
    Sep 7, 2004
  2. =?Utf-8?B?TWlrZSBNb29yZQ==?=

    Message Box (delete record - Yes or No) - Help!

    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    881
    matteo cunietti
    Oct 19, 2004
  3. Christian Ista
    Replies:
    5
    Views:
    3,143
    Johann MacDonagh
    Dec 7, 2004
  4. Gnarlodious
    Replies:
    4
    Views:
    17,587
    elizas
    May 5, 2010
  5. gnewsgroup
    Replies:
    0
    Views:
    1,044
    gnewsgroup
    Dec 13, 2007
Loading...

Share This Page