


























//aspx.cs
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox chkSelect = (CheckBox)e.Row.FindControl( "chkSelect ");
chkSelect.Attributes.Add( "onclick ", "show ( ' " + e.Row.RowIndex + " ') ");
}
}
//aspx页添加脚本
function show(index)
{
var table = document.getElementById( "GridView1 ");
for(var i = 1; i < table.rows[0].cells.length; i++)
{
alert (table.rows[index + 1].cells[i].innerText);
}
return false;
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。