Go homepage(回首页) Upload pictures (上传图片) Write articles (发文字帖)
The author:(作者)归海一刀published in(发表于) 2014/1/30 1:31:56 单击GridView某行获取该行某列内容并显示_[Asp.Net教程]
方法1:单击GridView某行获取该行某列值并显示在一个TextBox中
C# code //GV行添加JS事件 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", "gvselchange('" + e.Row.Cells[0].Text + "')"); } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", "gvselchange('" + e.Row.Cells[0].Text + "')"); }
}
赞