js showModalDialog应用实例

    技术2022-06-08  43

    主页:

    js:

    function showmodal(url, size, hidID, txtID) {            var ret = window.showModalDialog(url, null, size); //得到子窗体的值

                if (ret) {                document.getElementById(hidID).value = ret[0];                document.getElementById(txtID).value = ret[1];                document.getElementById("hid_CustomerName").value = ret[1];            }        }

     

    后台注册属性:

    SelectCustomer.Attributes.Add("onmousedown", "showmodal('/CommonManage/SearchCustomer.aspx','" + size + "','" + hid_Customer.ClientID + "','" + TxtCustomer.ClientID + "')");

     

    打开页:

    js:

    <script language="javascript" type="text/javascript">        /*接收选择企业的返回值,代理商或客户.  开始*/        function ReturnCompanyAndClose(CompanyID, CompanyFullName) {            var ret = new Array();            ret[0] = CompanyID;            ret[1] = CompanyFullName;            window.returnValue = ret;            window.close();        }    </script>

     

    后台注册属性:

    link.Attributes.Add("onclick", "ReturnCompanyAndClose('" + companyId + "' ,'" + companyName + "');");


    最新回复(0)