在GridView中增加几个按钮:
<asp:ButtonField Text="SingleClick" CommandName="SingleClick" Visible="False" />
LinkButton _singleClickButton = (LinkButton)e.Row.Cells[0].Controls[0];
// 返回一个字符串,表示对包含目标控件的 ID 和事件参数的回发函数的 JavaScript 调用
string _jsSingle = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "");
_jsSingle = "selectIndex(this," + e.Row.RowIndex.ToString() + ");" + _jsSingle;
e.Row.Attributes["onclick"] = _jsSingle;