求助,关于弹出对话框,求返回值的问题
我想实现在主页面中,点击ImageButton5,弹出对话框,使控件“巡视人员”(textbox)获得对话框的返回值,结果总是出错,请高手帮忙看看,谢谢,保证给分,相关代码:
主页面:
<asp:ImageButton ID="ImageButton5" runat="server" ImageUrl="/tup/yonghu.gif" onclientclick="openNewWeb()"
style="z-index: 1; left: 908px; top: 41px; position: absolute; width: 20px; height: 21px; bottom: 455px" />
<script type="text/javascript">
function openNewWeb() {
var str= window.showModalDialog("WebForm7.aspx",null,"dialogHeight=900px,dialogWidth=900px,center=1");
document.getElementById("巡视人员").value= str;
}
</script>
WebForm7.aspx:
<asp:Button ID="Button1" runat="server"
style="z-index: 1; left: 196px; top: 106px; position: absolute; width: 118px"
Text="Button" />
<script type="text/javascript">
function returnResult() {
window.returnValue = document.getElementById("Label1").value;
window.close();
}
</script>
vb代码
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Response.Write("<script language=javascript>returnResult()</script>")
End Sub