怎么把一个事件过程写到一个类中?
比如:GridView1_RowDataBound(Object sender, GridViewRowEventArgs e) 事件过程是:
if(e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Text = "<i>" + e.Row.Cells[1].Text + "</i>";
//执行某种操作
}
我想把它写到一个类中,当做方法调用。比如写到数据访问层中的DAL.SCTB.zhixing方法中
public void zhixing(Object sender, GridViewRowEventArgs e)
{
e.Row.Cells[1].Text = "<i>" + e.Row.Cells[1].Text + "</i>";
}
出现错误提示: GridViewRowEventArgs没有命名空间。我在网上查了一下它的命名空间是:System.Web.UI.WebControls
在上面引用了一下:using System.Web.UI.WebControls; 还是错误提示 System.Web下面没有UI....