• JS模式窗体


    前台只需这样写即可。

    <ItemTemplate>
    <asp:LinkButton ID="lbtnApplyNo" runat="server"  Text="打印" 
    OnClientClick='<%# Eval("ApplyNo","ShowApply(\"ShippingApplyPrint.aspx?ApplyNo={0}\");return false;") %>'></asp:LinkButton>
    </ItemTemplate>
    </asp:TemplateField>

    function ShowApply(url, width, height) {
        var dialogInfo = "";
        if (width > 0) {
            dialogInfo = "dialogWidth=" + width + "px;dialogHeight=" + height + "px";
        }
        else {
            dialogInfo = "dialogWidth=760px;dialogHeight=700px";
        }
        url = url + "&rn=" + Math.random();//使路径改变原来状态值。Math.random()是产生随机说的方法
        if (window.showModalDialog != null)//IE判断
        {
            var result = window.showModalDialog(url, "", dialogInfo);//传路径和模式窗体的高和宽
            if (result) {
                var urlParts = document.URL.split("?");
                var isUrl = window.location.href;
                if (urlParts[1]) {
                    isUrl = isUrl.replace(/contractNo=[^&]*/i, "ApplyNo=").replace(/sid=[^&]*/g, "sid=" + parseInt(10 * Math.random()));
                }
                else {
                    isUrl = isUrl.replace(/contractNo=[^&]*/i, "ApplyNo=").replace(/sid=[^&]*/g, "sid=" + parseInt(10 * Math.random()));
                }
                window.location.href = isUrl;
                //window.document.forms[0].submit();
            }
            return true;
        }
        window.open(url, "", "height=400px,width=800px");
        return true;
    }
    

     这是实现模式窗体效果。

    效果:

  • 相关阅读:
    2015 ccpc 南阳国赛
    CF 812
    多校 2009 7
    2015 长春
    多校 2009 4
    selenium 对https网站(加密证书)进行自动化测试
    selenium配置
    2016.05.17开通自己的博客
    pod存在,但是deployment和statefulset不存在
    Eclipse设置代码格式化使用空格代替TAB
  • 原文地址:https://www.cnblogs.com/huicao/p/2150321.html
Copyright © 2020-2023  润新知