日期:2014-05-19  浏览次数:20386 次

又要麻烦各位了```
linkbutton好象target啊````但是如果想实现点linkbutton在新的页面打开,应该怎么做啊????

------解决方案--------------------
private void LinkButton_Click(object sender, System.EventArgs e)
{
this.Page.RegisterStartupScript( "open ", " <script>
window.open( 'TrempMain.aspx ', 'ATA ', 'height=600,width=500,top=100,left=100,toolbar=no,menubor=no,scrollbars=auto,resizable=no,location=no,status=no ');
</script> ");
}

------解决方案--------------------
要链接,改为HyperLink,

或者写文本都可以
text = " <a href=\ "#\ " onclick=\ "window.open( '弹出页.aspx?id= " + id + " ', ' ', 'scrollbars=yes,width=800,height=600,resizable=yes ');return false;\ "> 文本 </a> ";
------解决方案--------------------
linkButton1.Attributes.Add( "onclick ", "OpenNewWindow( ' " + 要传递的参数 + " '); ");

然后javascript里面
function OpenNewWindow(id)
{
try
{
showNewWindows( "....aspx?ID= " + id );
}
catch(e)
{
showError(e);
}
finally
{
event.returnValue = false;
}
}

还可以设置弹出窗体的大小以及样式...