弹出窗口,关闭窗口刷新

时间:2022-09-19 23:40:01

 <input type="button" value="Edit" class="btn btn-primary btn-xs" onclick="EditComp()" />

<script type="text/javascript">
        function EditComp()
        {
            var comp_id =$("#<%=lblCompID.ClientID%>").text();
            if(comp_id=="" )
            {
                return;
            }
            var url = "../edit/EditCompany.aspx?comp_id=" + comp_id.toString() ;
            layer.open({
                type: 2,
                title: 'Edit Company',
                closeBtn: 1,
                shade: [0],
                area: ['910px', '550px'],
                content: [url, 'yes']

            });
        }

 

function closeLayer() {
             var index = parent.layer.getFrameIndex(window.name);
             parent.layer.close(index);
             winClose();
         }

<input type="button" value="Close"  onclick="closeLayer()"  class="easyui-linkbutton  searchFormButton"/>

第二种:

<script >

function openwin(id)
{

window.open("newwindow.aspx?id="+id,"newwindow","height=500,width=800,toolbar=0,member=no,scrollbars=no,reszable=no,location=no,stuatus=no")
}
</script>

repeater包含的  <asp:Label ID="lblID" runat="server" Text='<%# Eval("id")%>'></asp:Label>

<a onclick="openwin(<%# Eval("id")%>)">----</a>跳转

 

点击添加按钮,弹框js

<script>
        function Add() {
            $('#div_add').dialog('open').parent().appendTo($("form"));
        };
        function ColseDialog() {
            $('#div_add').dialog('close');
        }

    </script>

<input style="margin-left:5px" type="button" onclick="Add()" value="Add Password" class="btn btn-primary btn-xs" />

<div id="div_add" title="addPassword" class="easyui-dialog" closed="true" style="width: 450px; height: 250px; padding: 10px;" data-options="iconCls:'icon-save',closable:true">
          <table>

          <tr>

              <td>
                    <asp:TextBox ID="txt_password" runat="server" Width="220px" CssClass="easyui-textbox"></asp:TextBox>
                </td>
            </tr>
          
            <tr>
                <td>&nbsp;</td>
                <td>
                    <asp:Button ID="btnConfirmAdd" runat="server" Text="Add" CssClass="easyui-linkbutton searchFormButton"     OnClick="btnConfirmAdd_Click" />
                    <input style="margin-left: 10px;" type="button" value="Cancel" onclick="ColseDialog()" class="easyui-linkbutton  searchFormButton" />
                </td>
            </tr>
        </table>
    </div>