How to show a confirm dialog?

Discussion in 'ASP .Net' started by ad, Jun 4, 2005.

  1. ad

    ad Guest

    I want user can confirm before delete records ?
    How can I show a confirm dialog when users press a button?
     
    ad, Jun 4, 2005
    #1
    1. Advertising

  2. Here's some server side code that uses javascript to display a confirmation
    message.

    myDeleteButton.Attributes.Add("onclick", _
    "return confirm('Are you sure you want to delete?');")

    In this example, the Delete button will post back only if the person
    confirms they want to delete. Otherwise your server code is never called in
    response to the button click.

    Here's a more detailed analysis of your options, including a free control
    that can handle many of the options for you.
    http://SteveOrr.net/articles/ClientSideSuite.aspx

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "ad" <> wrote in message
    news:...
    >I want user can confirm before delete records ?
    > How can I show a confirm dialog when users press a button?
    >
    >
     
    Steve C. Orr [MVP, MCSD], Jun 4, 2005
    #2
    1. Advertising

  3. ad

    ad Guest

    Thank for your immediately answer.
    I wnat to show a progress bar dialog after the user press Yes in the confirm
    dialog.
    The javascript function for Show progress bar dialog is
    _ShowProgressWindow();
    I do that with the code:
    myDeleteButton.Attributes.Add("onclick", "return confirm('Are you sure you
    want to delete?');");
    myDeleteButton.Attributes.Add("ShowProgressWindow()");
    But it fail to show Progress bar!
    How can I add two event handle to one event in javascript?




    "Steve C. Orr [MVP, MCSD]" <> ¼¶¼g©ó¶l¥ó·s»D
    :OcH5#...
    > Here's some server side code that uses javascript to display a

    confirmation
    > message.
    >
    > myDeleteButton.Attributes.Add("onclick", _
    > "return confirm('Are you sure you want to delete?');")
    >
    > In this example, the Delete button will post back only if the person
    > confirms they want to delete. Otherwise your server code is never called

    in
    > response to the button click.
    >
    > Here's a more detailed analysis of your options, including a free control
    > that can handle many of the options for you.
    > http://SteveOrr.net/articles/ClientSideSuite.aspx
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://SteveOrr.net
    >
    >
    > "ad" <> wrote in message
    > news:...
    > >I want user can confirm before delete records ?
    > > How can I show a confirm dialog when users press a button?
    > >
    > >

    >
    >
     
    ad, Jun 4, 2005
    #3
  4. ad

    ad Guest

    Thank,
    But I can't understand, could you give me more information?

    "Steve C. Orr [MVP, MCSD]" <> ¼¶¼g©ó¶l¥ó·s»D
    :OcH5#...
    > Here's some server side code that uses javascript to display a

    confirmation
    > message.
    >
    > myDeleteButton.Attributes.Add("onclick", _
    > "return confirm('Are you sure you want to delete?');")
    >
    > In this example, the Delete button will post back only if the person
    > confirms they want to delete. Otherwise your server code is never called

    in
    > response to the button click.
    >
    > Here's a more detailed analysis of your options, including a free control
    > that can handle many of the options for you.
    > http://SteveOrr.net/articles/ClientSideSuite.aspx
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://SteveOrr.net
    >
    >
    > "ad" <> wrote in message
    > news:...
    > >I want user can confirm before delete records ?
    > > How can I show a confirm dialog when users press a button?
    > >
    > >

    >
    >
     
    ad, Jun 4, 2005
    #4
    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. Tony Baker
    Replies:
    0
    Views:
    6,712
    Tony Baker
    Dec 17, 2003
  2. Patrick Delifer

    JS Confirm dialog from datagrid template column

    Patrick Delifer, Apr 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    696
    Patrick Delifer
    Apr 28, 2004
  3. =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?=

    Problem showing confirm dialog on button webcontrol's onclick even

    =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?=, Jun 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,553
    Peter Blum
    Jun 2, 2005
  4. =?Utf-8?B?UHJpeWE=?=

    confirm dialog , return value

    =?Utf-8?B?UHJpeWE=?=, Dec 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    990
    Teemu Keiski
    Dec 26, 2005
  5. =?Utf-8?B?UmFq?=

    Script Manager - Confirm dialog box

    =?Utf-8?B?UmFq?=, May 18, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,878
    Thomas Hansen
    May 18, 2007
Loading...

Share This Page