I have a requirement for a web page where I need to open one dialog box to capture information from the page, and depending on the user data requirements, I need to open a second dialog box from the first dialog box on the page to capture more detailed information.
I have create two sample projects, one with a single modal dialog box, and one project with two modal dialog boxes, the first one to be opened from the page, and the second one to be opened from the first dialog box.
The single dialog box project works as expected, almost. The text box has a calendar extender on it, and the calendar will only work if it is defined in the aspx file before the button with the modal dialog box on it. If the modal dialog box is first, then the calendar extender does not function.
The two dialog box project does not work as expected. First, when you click on the button to open the first dialog box, the screen flashes and does not open the dialog box. When you click on the button a second time, the first dialog box opens as expected. You can click on the OK button or the Close button and it works as expected. When you click on the button to open the detail dialog box, the panel is opened not as a dialog box but as part of the underlying page. All controls on the primary page are accessible. When you close the second dialog box, the first dialog box is not displayed. The page goes back to the underlying page only.
All binaries (including the AjaxToolkit package) have been stripped out of the attached zip to to allow the size of the file to be under the 4MB maximum.
Comments: I have reviewed the sample project and I understand the resolution. Removing values from the CancelControlID and the OKControlID of the ModalPopupExtender allows the code behind to operate and process the data on each modal dialog box as the user clicks on each button.
I have a couple of further issues that I need to resolve.
The buttons to display the modal dialog boxes are assigned to the TargetControlID of the ModalPopupExtender control. That property is required to be assigned a value. On clicking the button, these buttons do display the modal dialog box properly.
The issue is that I need to run some code on the server on clicking the button to display a modal dialog box so that the modal dialog box can be initialized. There is information within the modal dialog box that must be initialized based on information that the user has entered in the underlining page.
The second issue is being able to display a modal dialog box on clicking a button within row on a GridView control. In this case, the code behind must run to determine which row was selected, and populate the modal dialog box with information based on the selected row.
Last, if I want to leave the first modal dialog box visible as a reference display under the second modal dialog box, the controls on the first modal dialog box are still enabled. I need to be able to disable all the controls on the first modal dialog box. This would be useful where the modal dialog boxes are allowed to be moved so that the user can view the data on the first modal dialog box while using the second modal dialog box to enter detail data.