window.showModalDialog怎么接收跳转页面的返回值
我在主页面js中调用
var file_path = window.showModalDialog("../a.htm", null, "dialogWidth=450px;dialogHeight=150px;center=yes;status=no");
<form id="form1" method="post" enctype="multipart/form-data" action="b.aspx">
<input id="testId" type="file" name="testName" />
<input id="testSubmit" type="submit" value="上传" />
</form>
<body>
<form id="form1" method="post" enctype="multipart/form-data" action="b.aspx" target="result">
<input id="testId" type="file" name="testName" />
<input id="testSubmit" type="submit" value="上传" />
</form>
<iframe id="result" style="display:none"></iframe>
</body>
Response.Clear();
Response.Write(@"<script>
var win = window.parent;
win.returnValue = 'xxxxxx';
win.close();
</script>");
Response.End();
document.getElementById('<%=Button2.ClientID %>').click();
}
</script>
弹出窗口页:
Page.ClientScript.RegisterStartupScript(GetType(), string.Empty, "<script>var arr=[" + rdobtain + "];window.returnValue=arr;window.close();</script>");
应该能看懂吧 很简单的 不用你那么麻烦