In ie, the js method showmodaldialog () can be used directly in the pop-up modal box. This method is supported after firefox3.0, but not in earlier versions of Firefox and opera. the JS standard window is required. open () method.
Window. Open Syntax:
Onewwindow=Window. Open ([Surl][,Sname][,Sfeatures][,Breplace])
Returns the object on the current pop-up page. In the pop-up window, you can useWindow. OpenerTo obtain the parent window object, you can directly access the client control of the parent window or call its js method for operations:
Window. Opener. Setvalues (val1, val2 ...);
This problem is often encountered during actual development. the parent window is refreshed based on the value returned by the Child Window, but this refresh is generally only partial, rather than refreshing the entire page. in this case, AJAX can be used to call the background method in Js. however, I recommend another refresh method, which is simpler, more convenient, and effective. it is to virtualize a button in JS and refresh the page by clicking the button in the corresponding function.
Function setvalue (strmsg)
{
// You can record the passed value to the hidden control,
// Later, the button response function operates from the value of the hidden control.
VaR button = Document. getelementbyid ("<% = button2.clientid %> ");
Button. Click ();
}
In this way, the pop-up page box in IE, Firefox, and opera is implemented and the value is returned.
You can place the button that is clicked in a div and set the display attribute of the DIV to "NONE", because if the size of the button is set to (0, 0, the display in Firefox and opera is abnormal. for details, refer to the source code, default. the ASPX page is the parent page, child. aspx is a sub-page, which defaults when running. set aspx to the starting page.
Source code:
Page refresh of window. Open Method
<Transferred from> Molby home brothers blog