.NET中GridView控件的高亮显示和删除前弹框提示
时间:2010-11-20 来源:唐学阳
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//删除前弹框提示
LinkButton b = e.Row.FindControl("LinkButton1") as LinkButton;
b.Attributes.Add("onclick", "return confirm('确定要删除吗?');");
//高亮显示
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#66ff99'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
相关阅读 更多 +
排行榜 更多 +