Implement form's onSubmit functionality

Discussion in 'ASP .Net Web Controls' started by Vi, Dec 15, 2005.

  1. Vi

    Vi Guest

    Hi,
    I have a LinkButton control that deletes a user from a database. I'd like to
    display a client side alert window prompting the user to confirm the delete
    so that if the users clicks "NO", the form is not posted to the server
    (something I would do in classical ASP with onSubmit in the form's
    declaration).

    What is the easiest/best way to achive this?
    Thank you.
     
    Vi, Dec 15, 2005
    #1
    1. Advertising

  2. vi, on your Page_Load add something like the following. if your confirm is
    yes, the code will continue to the delete event. HTH

    Jose

    btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you wish
    to delete?'






    "Vi" <> wrote in message
    news:...
    > Hi,
    > I have a LinkButton control that deletes a user from a database. I'd like
    > to
    > display a client side alert window prompting the user to confirm the
    > delete
    > so that if the users clicks "NO", the form is not posted to the server
    > (something I would do in classical ASP with onSubmit in the form's
    > declaration).
    >
    > What is the easiest/best way to achive this?
    > Thank you.
     
    Jose Rodriguez, Dec 15, 2005
    #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. phl
    Replies:
    0
    Views:
    446
  2. Bit Byte
    Replies:
    1
    Views:
    558
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Feb 25, 2007
  3. Randy Kramer
    Replies:
    4
    Views:
    114
    Randy Kramer
    Oct 15, 2007
  4. Kai Grossjohann
    Replies:
    4
    Views:
    287
  5. Replies:
    1
    Views:
    111
    Randy Webb
    Nov 2, 2006
Loading...

Share This Page