asp.net中 button 打开新的页面

来源:百度知道 编辑:UC知道 时间:2024/05/03 03:40:39
asp.net中 button 打开新的页面?要求不被浏览器拦截

lbtnViewAll.Attributes.Add"onclick","window.open('***.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=800,height=500,left='+(screen.width-760)/2+',top='+(screen.height-500)/2);return false");

弹出窗口提示,跳转到新页(两种方法):

ClientScript.RegisterClientScriptBlock(this.GetType(), null, "<script>alert('提示');window.location='Message.aspx';</script>");

ClientScript.RegisterStartupScript(this.GetType(), null, "<script>alert('提示');window.location='Message.aspx';</script>");

<input type="button" onclick="window.open('http://www.sina.com')" value="new window"/>

这样不就可以了吗!Response.Redirect("Message.aspx")