Sample code: Add delete confirmation to a GridView Control.

Discussion in 'ASP .Net' started by johnmott, Sep 12, 2007.

  1. johnmott

    johnmott Guest

    Hi all,

    One of the limitations of the GridView control is that the built-in
    delete processing doesn't prompt for confirmation -- something thats
    very important for a user interface. True, you can add server side
    logic for this, but its much more reassuring to have a Javascript
    confirmation window open up and prompt. There are several techniques
    for doing this, just google 'Gridview delete confirm' to see them.
    I've figured out one which does not involve adding logic to the GridView
    setup, so there are fewer moving parts. And, it still preserves the ViewState.
    There is a small amount of C# code to perform the actual record delete, but
    this is mostly a client-side/Javascript technique.

    The sample application with source is available at

    App: http://www.nicecleanexample.com/ViewApp.aspx?TID=gridviewconfirmdel

    Hope it helps.

    John
    johnmott, Sep 12, 2007
    #1
    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. mpenev

    Delete confirmation in GridView

    mpenev, Sep 30, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,001
    mpenev
    Sep 30, 2005
  2. Steve
    Replies:
    1
    Views:
    7,478
    Steve
    Dec 2, 2005
  3. johnmott
    Replies:
    0
    Views:
    458
    johnmott
    Aug 30, 2007
  4. ASMJ
    Replies:
    0
    Views:
    198
  5. Les Juby
    Replies:
    2
    Views:
    93
    Phat G5 (G3)
    Aug 5, 2005
Loading...

Share This Page