Action after confirmation from client -- asp.net

Discussion in 'ASP .Net' started by sweetpotatop@yahoo.com, Sep 21, 2007.

  1. Guest

    Hi,

    I have an asp.net project written in C#

    It has a list of records for users to delete and select. When user
    click the "Delete" button, I would like to ask the user to confirm
    before I proceed.

    And I have something like this in my code
    button1.Attributes.Add("onClick", "return confirm('Some Prompt');");

    If the user says yes, I have to run the code in server, which will
    delete the records.

    My question is, how does the server-side code gets the return value of
    the confirmation, which I believe on the client-side?

    Please help. Your help would be greatly appreciated.
     
    , Sep 21, 2007
    #1
    1. Advertising

  2. It doesn't. The confirmation should basically abort the whole process if the
    user doesn't confirm. This will mean that the only way to actually get to
    the postback stage is to return a true condition from the confirm. Otherwise
    the postback won't occur and the code just won't get executed so there's no
    need for you to try to get the values.


    --
    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - FrontPage

    <> wrote in message
    news:...
    > Hi,
    >
    > I have an asp.net project written in C#
    >
    > It has a list of records for users to delete and select. When user
    > click the "Delete" button, I would like to ask the user to confirm
    > before I proceed.
    >
    > And I have something like this in my code
    > button1.Attributes.Add("onClick", "return confirm('Some Prompt');");
    >
    > If the user says yes, I have to run the code in server, which will
    > delete the records.
    >
    > My question is, how does the server-side code gets the return value of
    > the confirmation, which I believe on the client-side?
    >
    > Please help. Your help would be greatly appreciated.
    >
     
    Mark Fitzpatrick, Sep 21, 2007
    #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. angus

    client confirmation in asp.net

    angus, Jun 24, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    414
    angus
    Jun 24, 2004
  2. Joe Bloggs
    Replies:
    1
    Views:
    924
    Sudsy
    Aug 3, 2003
  3. rjweytens
    Replies:
    6
    Views:
    16,254
    rjweytens
    Jun 25, 2004
  4. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,915
    runescience
    Feb 7, 2006
  5. vyshu
    Replies:
    1
    Views:
    2,632
    Richard Senior
    Apr 27, 2007
Loading...

Share This Page