比如: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....
{
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....
if(e.Row.RowType == DataControlRowType.DataRow)
{
//这里还要加上检测e.Row.Cells是否有索引1和索引1是否为null的代码避免异常
e.Row.Cells[1].Text = do(e.Row.Cells[1].Text);
}public string do(string value)
{
...
}
{
.....
}
public delegate TEventHandler(object o,TEventArgs e);
public class a
{
.....
public event CellChanged;
}写错了别笑,很久没用了。1