zoukankan      html  css  js  c++  java
  • 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;
    }
    

     这是实现模式窗体效果。

    效果:

  • 相关阅读:
    Android无限循环轮播广告位Banner
    Android自定义View绘图实现拖影动画
    Android Material Design : Ripple Effect水波波纹荡漾的视觉交互设计
    ArrayList的线程安全测试
    异常总结
    java反射
    数据结构之链表
    移位运算符
    java设计模式:单例模式
    第三章:多态
  • 原文地址:https://www.cnblogs.com/huicao/p/2150321.html
Copyright © 2011-2022 走看看