Action after confirmation from client -- asp.net

S

sweetpotatop

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

Mark Fitzpatrick

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.
 

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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top