Implement form's onSubmit functionality

V

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.
 
J

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?'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,083
Latest member
SylviaHarr

Latest Threads

Top