用于创建网页的ASP.Net代码 [英] ASP.Net Code For Create A Web Page
本文介绍了用于创建网页的ASP.Net代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请发送代码,该代码单击按钮或链接或图像,然后在新窗口中打开网站.
Please Send The Code That Click On Button Or Link Or Image Then Open Site In New Window
推荐答案
JavaScript是最好的方法.
Javascript is the best way to do.
tmpJScript = "javascript:window.open('URL address','','left=20,top=20,width=550,height=650,status=1,resizable=1,scrollbars=1');return false;";
LinkButton.Attributes.Add("onClick", tmpJScript);
<像YANGQ一样的br/>
使用javascript的window.open
功能.这是文档 [
like YANGQ said use javascript''s window.open
functionality. Here is doc [^]for you.
aspx页面
在标题内
aspx page
within header
<script type="text/javascript">
function NewWindow()
{
top.window.open("http://www.google.com",'800x300','toolbar=no,scrollbars=yes,resizable=yes,status=no,location=no,menubar=no,directories=no,width=800,height=300');
}
</script>
并在表格中
and within form
<asp:Button ID="Button1" runat="server" Text="New Window" OnClientClick="NewWindow()" />
<input type="button" value="New Window" onclick="NewWindow()" />
<a href="javascript:return fasle" onclick="NewWindow()"> New Window</a>
这篇关于用于创建网页的ASP.Net代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文