【发布时间】:2008-12-18 07:58:22
【问题描述】:
在 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();
}
【问题讨论】: