我想在gridview 中找到控件(超链接)。根据控件的值,我想启用或禁用超链接。我试过这样。但我总是变得空虚。
protected void gridResult_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink status = e.Row.FindControl("id") as HyperLink;
if ( status != null && status.Text == "AAAA" ) {
status.Enabled = false;
}
}
}
请帮忙。