两个页面之间通过后台处理,调用父窗体方法。

exam_edit.aspx.cs页(子页后台):

  this.ClientScript.RegisterStartupScript(this.GetType(), "message", "parent.layer.closeAll();parent.setOption('好的','12');", true);

import_result.aspx(父页前台): 

       function setOption(key, value) {
                    var builder = "<option value='" + value + "'>" + key + "</option>";
                    $("#tongyi").append(builder);
                    $("#tongyi").find("option[value='" + value + "']").attr("selected", "selected");
                    layui.form().render('select');
                }

 即可完成,其中在刷新前台页select时出现小问题,总是报form is undefind.

最后通过

 layui.form()解决问题。
posted @ 2017-08-30 15:27  阿旭92312  阅读(134)  评论(0编辑  收藏  举报