日期:2014-05-18  浏览次数:20487 次

LinkBut的问题
需要实现这样的一个功能
LinkButBPCall.Text   =   "http...... "
LinkButBPCall.OnClientClick   =   "OpenWin() ";//   打开http.....这个链接但是不要刷新当前页面   还有那个OpenWin()的js   怎么写   win.open吗?   会不会被拦截呢?
谢谢大家~~   我是新手..

------解决方案--------------------
LinkButBPCall.Attributes.Add( "onclick ", "window.open( 'http://www.baidu.com ');return false; ");
------解决方案--------------------
传值页:
HTML:
-------------------------------------------------

<script type= "text/javascript ">
function btnGetReturnValue_onclick()
{
var num=new Array();
num[0]=0;
num[1]=1;
window.showModalDialog( "Temp.aspx ",num, "center=yes;help=no;status=no ");
}

</script>

....
<input type= "button " name= "btn " value= "ok " onclick= "btnGetReturnValue_onclick(); " />


目标页:
HTML:接值
------------------------------------------------------

<script type= "text/javascript ">
<!--
function getValue()
{
var num=new Array();
num=window.dialogArguments;//接收传递过来的值
document.form1.txt1.value=num[0];
document.form1.txt2.value=num[1];

document.form1.TextBox1.value=num[0];
document.form1.TextBox2.value=num[1];
}
-->
</script>
</head>
<body onload= "getValue(); ">
<form id= "form1 " runat= "server ">
<input id= "txt1 " name= "txt1 " type= "text " />
<input id= "txt2 " name= "txt2 " type= "text " />
<asp:TextBox ID= "TextBox1 " runat= "server "> </asp:TextBox>
<asp:TextBox ID= "TextBox2 " runat= "server "> </asp:TextBox>
</form>
</body>
</html>