前台代码:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)//gridview的行绑定
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "return openLink('admin')");//双击后传给前台js的参数
}
}
后台js文件:
<script type= "text/javascript">
function openLink(url) //url是后台传过来的参数
{
window.open("purchase_article.aspx?ur=" + url, "1", "resizable=yes,toolbar=no,statusbar=no,menubar=no,location=no,scrollbars=yes,titlebar=no,width:900,height:700");
}
</script>