如何在新窗口中打开页面并发送数据?

我已经尝试了2天了。 在ASP.NET和VB.NET中,我有page1.aspx和page2.aspx 我想在page1.aspx中按button1来触发button1.click事件并在新窗口中打开page2.aspx并向其发送数据。 如果没有新的窗口,可以通过Server.Transfer或Response.Redirect轻松完成所有这些操作。 但不幸的是,他们没有选择打开一个新窗口。 谢谢, 艾哈迈德。 - 更新 - 我已经使用过这个解决方案,但无法发送参数,它打开了我的第0页!
    <asp:Button ID="Add" runat="server" Text="Add" OnClientClick ="return pageOpen(TextBox1.SelectedValue, TextBox2.SelectedValue);"/> 
而javascript是:
     <script type="text/javascript">
     function pageOpen()
    {
        window.open("page2.aspx?param1=" & arguments[0] & "&param2=" & arguments[1])
    }
</script> 
    
已邀请:
function openWindow() {
window.open('Page2.aspx?Arg1=' + document.getElementById('<%= txt1.ClientID %>').value + '&Arg2=' + document.getElementById('<%= txt2.ClientID %>').value, 'Title');
}


<asp:TextBox ID="txt1" runat="server" />
<asp:TextBox ID="txt2" runat="server" />
<asp:Button ID="btn" Text="Add" OnClientClick="openWindow()" runat="server" />
这应该工作......     
您需要使用查询字符串中的数据在Javascript中调用
window.open
。     

要回复问题请先登录注册