Pop Up windows

B

Bilbo

Hello,

What is the best approach to bringing up pop-up windows to verify a users
request. (i.e. - "Are you sure you want to delete? yes no)

I know how to bring the window up in javascript...but once the user click
"yes" in the new pop-up window, I need to somehow invoke a delete call in
the c# code behind of the original page.

Any help would be appreciated.

Thanks.
 
B

Ben Lucas

Using either a Button or LinkButton control, you can add the "onclick"
attribute to it and place the javascript code in there.

For example:

lnkCancel.Attributes.Add("onclick", "return window.confirm('Are you sure
you want to cancel this order?');");

If the user clicks OK, the button will submit and the appropriate
code-behind for the button will be executed. If the user clicks cancel,
then the form will not submit.
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top