Not too long ago I posted about how the ASP.NET Modal Popup Rocks the Casbah. Well, I just took it a step further and I thought I'd share my excitement with you. So I asked, to nobody in particular, "What, praytell, would happen if I set the targetcontrolID of the control to launch the popup to, say, a drop down list?" Good question. I'm glad I asked. What happens is the modal popup launches, and fades out everything else on the page, but since you were in the process of changing a dropdown, you still maintain control over it - until it loses focus, at which point it too becomes faded and unselectable. If you change the value of the dropdown, you can update the modal popup to reflect your changes:
Step 1) Make sure you've set your dropdown to autopostback=true
Step 2) Make an event handler for the SelectedIndexChanged event
Step 3) Make sure your dropdown and your modal popup resides within an Ajax Update Panel, of course
Step 4) Within the event handler you created in Step 2, you have to re-set your modal popup to visible: yourmodalpopup.show()
Now, if you *don't* change the value in the dropdown, the selectedindexchanged event won't fire, and your modalpopup remains visible. So whatever functionality you have in your modal popup should probably start out hidden *until* its made visible during the postback for the dropdown. You could also disable the buttons in the popup and show text that says "You must change the value in the dropdown to do whatever you'[re going to do here" and then change that text during the postback.