First, refer to layer and download it yourself.
Add the following two lines
<script src= ". /layer/jquery.min.js "></script>
<script src= ". /layer/layer.js "></script>
Layer.open ({type:2, Skin:' Layui-layer-lan ', Title:Title, FIX:false, Shadeclose:true, Maxmin:true, area: [' 800px ', ' 400px '], content:' Default.aspx ', //end:function () {//Turn off popup layer triggering //location.reload (); Refreshes the parent interface and can be changed to another //} });
In the popup layer, how to click Submit or save, automatically close the popup layer, refresh the parent interface? Here to answer for everyone.
Suppose there are two interfaces, Default.aspx and Default2.aspx, respectively.
Set a button control in Default.aspx and hide it as follows:
<asp:button id= "Button1" runat= "Server" text= "Refresh" onclick= "Button1_Click" style= "Display:none"/>
The event content of a control Button1 can be used to save temporary data, prevent the user from filling out, not save, and refresh the interface to cause data loss.
Next is the JavaScript call to the control.
<script>
function ShowData () { document.getElementById ("Button1"). Click (); var index = parent.layer.getFrameIndex (' default2.aspx '); Parent.layer.close (index); }
</script>
Add the following code to the Submit or Save button event in the popup layer:
Scriptmanager.registerstartupscript (this "jsfun " " <script type=\ "text/javascript\" >alert (' Submit success! '); Parent. ShowData ();</script>"false";
Can be implemented, the user click Submit or save, pop-up prompt box, automatically close the pop-up layer, and refresh the parent interface.
JavaScript implementation Popup Layer (take Layer.open as an example)