在 RowDataBound OnClick 事件处理程序中,'Hi'
当我单击任何行时会打印它。但我希望它只在我点击第 15 行时打印“嗨”。我该如何实施?
我的代码:
protected void dtvExDetails_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.DataItemIndex == -1)
return;
e.Row.Attributes.Add("onMouseOver","this.style.cursor='hand';");
e.Row.Attributes.Add("onclick", this.GetPostBackClientEvent(dtvExDetails, "Select$15"));
}
protected void dtvExDetails_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Write("hi");
DataGrid();
}