如何在asp.net中打开新标签的代码,c# [英] How to code to open new tab in asp.net,c#
本文介绍了如何在asp.net中打开新标签的代码,c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友......
i需要在我的网站点击按钮打开新标签..
怎么做?
提前致谢..
hello friends...
i required in my website to open new tab whn i m clicking on button..
How to do this??
Thanks in advance..
推荐答案
使用以下代码。
use the following code.
Protected Sub btnReport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReport.Click
Dim popupScript As String = "<script language="javascript">" + "window.open('Report.aspx', 'newWindow', 'left=2, top=2,location=no, width=1010, height=660, menubar=no, resizable=yes,statusbar=yes,scrollbars=yes');" + "</script>"
Page.RegisterStartupScript("Google", popupScript)
End Sub
在按钮点击事件中添加此代码处理程序
Add this code in your button click event handler
ClientScript.RegisterStartupScript(this.Page.GetType(), "",
"window.open('somepage.aspx','Graph','height=400,width=500');", true);
它并不复杂......只需在asp按钮上添加一个属性
OnClientClick =window.open('YourPage.aspx')
its not that much complicated... just add a property to your asp button
OnClientClick="window.open('YourPage.aspx')"
这篇关于如何在asp.net中打开新标签的代码,c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文