asp.net window.showModalDialog 后台用法(兼容谷歌浏览器)

   StringBuilder s = new StringBuilder();
            s.Append("");
            Type cstype = this.GetType();
            ClientScriptManager cs =this.ClientScript;
            string sname = "lt";
            if (!cs.IsStartupScriptRegistered(cstype, sname))
                cs.RegisterStartupScript(cstype, sname, s.ToString()); 

父页面

按钮事件代码

StringBuilder s = new StringBuilder();
            s.Append("");
            Type cstype = this.GetType();
            ClientScriptManager cs = this.ClientScript;
            string csname = "ltype";
            if (!cs.IsStartupScriptRegistered(cstype, csname))
                cs.RegisterStartupScript(cstype, csname, s.ToString());

子页面 按钮事件代码

下面的传多个值的时候记得加‘’号

 StringBuilder s = new StringBuilder();
                s.Append("");
                Type cstype = this.GetType();
                ClientScriptManager cs = this.ClientScript;
                string csname = "ltype";
                if (!cs.IsStartupScriptRegistered(cstype, csname))
                    cs.RegisterStartupScript(cstype, csname, s.ToString());


子页面一定记得在head中加入   

你可能感兴趣的:(asp.net)