Results 1 to 6 of 6

Thread: Using the Confirm dialog

  1. #1
    Join Date
    Nov 2008
    Posts
    3,952

    Using the Confirm dialog

    I have a button to delete a record that is displayed in a list. The deletion is good to get to, but I would like the user to verify the deletion by pressing Yes in a dialog box asking. Is there an easy way to get to such a message box on the client side?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Using the Confirm dialog

    This works at least in a Grid View:

    Code:
    <ItemTemplate> 
    <asp: Link Button ID = "Delete" runat = "server" 
    OnClientClick = "return confirm ( 'Do you want to delete this record ?');" 
    Command Name = "delete"> Delete </ asp: Link Button> 
    </ItemTemplate>

  3. #3
    Join Date
    Nov 2008
    Posts
    3,952

    Re: Using the Confirm dialog

    Now assumes that this is a DELETE command in any form for .NET component. I'm talking about a button in the interface that is not in some kind of itemtemplate etc.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Using the Confirm dialog

    I assumes nothing. What I said was:

    "This works at least in a Grid View."

    You said nothing about the interface.

  5. #5
    Join Date
    Nov 2008
    Posts
    3,952

    Re: Using the Confirm dialog

    You're right. But I was looking for a way to get to a CONFIRM. I have tried to put on it but get error while running on the client side

  6. #6
    Join Date
    May 2008
    Posts
    945

    Re: Using the Confirm dialog

    If you have a button that performs the deletion (btnDelete in this example), you can fling this in your code:

    btnDelete.Attributes.Add ( "onclick", "return confirm ('Are you sure that you are common to delete this)");

    Is really just the same as Zecho says. Running a JavaScript dialog box with two buttons. Press 'ok' continues it; press 'cancel' nothing happens.

Similar Threads

  1. want to confirm that htc rezound is a world phone
    By Kesar in forum Portable Devices
    Replies: 4
    Last Post: 11-11-2011, 07:22 PM
  2. Any way to confirm ECC functioning
    By Cherokee in forum Motherboard Processor & RAM
    Replies: 6
    Last Post: 05-09-2010, 05:54 AM
  3. Javascript- Prompt, Alert and Confirm Box example
    By Javiier in forum Software Development
    Replies: 3
    Last Post: 08-12-2009, 03:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,719,271,889.41735 seconds with 17 queries