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 Answers 3

5

Have you looked at the ModalPopupExtender?

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

Sign up to request clarification or add additional context in comments.

1 Comment

Hey that is pretty neat. I'm looking for multiple ways. Do you know of a non ajax way?
3

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.

Comments

1

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.

1 Comment

To return values from that "popup" window, use javascript's "window.returnValue"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.