views:

1043

answers:

3

I would like to create a javascript modal pop up window to get some values from a user in a ASP.Net 2.0 webpage.

The basic idea is this. When a user clicks a button, a modal window will come up and ask 3 or 4 questions. The asp.net page will not be able to be changed while this window is up. Once the questions have been answered I need to grab the values from this window so the asp.net page has access to them and can handle them in the code behind.

Can I please get some examples on how you would implement this scenario.

+3  A: 

Have you looked at the ModalPopupExtender?

http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx

Jon Sagara
Hey that is pretty neat. I'm looking for multiple ways. Do you know of a non ajax way?
Joshua Hudson
+2  A: 

The easiest methods would be to either use ModalPopupExtender as mentioned by Jon or potentially use jQuery's thickbox or something similar as well.

Otherwise, you could roll your own JS to do it.

Mitchel Sellers
+1  A: 

You could use the javascript function 'window.showModalDialog', but it only works in Internet Explorer.

You can pass in and return any number of variables by wrapping them up into an object.

Robin Bennett