62,046
社区成员
发帖
与我相关
我的任务
分享
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Button id="Button1" runat="server" Text="Button" OnClick="Button1_Click"></asp:Button> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<div id="Open" runat="server"></div>
</contenttemplate>
</asp:UpdatePanel>
</form>
protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "opennewwindow", "window.open(\"http://www.baidu.com/\");", true);
}
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function call()
{
window.open("http://www.baidu.com/");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Button id="Button1" runat="server" Text="Button" OnClientClick="call()"></asp:Button> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
</contenttemplate>
</asp:UpdatePanel>
</form>
</body>
</html>