Pop Up windows

  • Thread starter Thread starter Bilbo
  • Start date Start date
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.
 
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.
 
Back
Top