Home All Groups Group Topic Archive Search About

Implement form's onSubmit functionality

Author
15 Dec 2005 8:30 PM
Vi
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.

Author
15 Dec 2005 10:57 PM
Jose Rodriguez
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?'






Show quoteHide quote
"Vi" <V*@discussions.microsoft.com> wrote in message
news:04B9BA5F-9142-4881-B412-AFBC637E4031@microsoft.com...
> 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.