We often have to use the modal window in the program's human-computer, but in B / S development, it is not easy, although it can also be implemented with a Window.ShowModalDialog function (see http: //dotnet.aspx .cc / showdetail.aspx? id = 49ml4ao8-5pb3-4kny-njzd-ljioxv4m1x4), but most of them use trouble, but also to establish 2 useless windows for the return value. accurate!
I have found that you can try to embed an IFRAME in the initial page, then use iframe to display a page, and set the iframe to place it in absolute position, z-index is set to the highest 9999, so you can overwrite this page in the initial On the interface, when you need to display the modal window, you will display this iframe, you can enlarge the size of the IFRAME to cover the initial window, or you can cover the key item, the purpose is to do so changes in the back window. When the window displayed in the iframe needs to be closed, you can hide the iFrame on it. When the actual test, IFRAME Diaplay cannot be changed at the sub-window, so we also need to put iframe in a DIV, control the display of the DIV, can control the appearance or hide of the window. But why not use DIV to display the window, there are two reasons: 1.DIV cannot block the DropDownList control behind it, and iframe can. 2. Not easy to place the content in the window into a separate web page, and the reuse is poor.
The following is the code, showing the hidden use of both client and server code:
Webform1.aspx
<% @ Page language = "c #" codebehind = "Webform1.aspx.cs" autoeventwireup = "false" inherits = "wsteri1.webform1"%>