日期:2014-05-17 浏览次数:20466 次
protected void rep_Topic_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView dr = (DataRowView)e.Item.DataItem; dr["你的字段"] }
------解决方案--------------------
在前台中
<%# GetDString(Eval(startTime),Eavl(EndTime)) %>
public string GetDString(object StarTime,Object EndTime)
{
DateTime dt=DataTime.Now.ToString("yyyy-MM-dd");
if(判断条件)
{
ReTurn "未开始";
}
else if(判断条件)
{
ReTurn "正在进行";
}
else if(判断条件)
{
ReTurn "已经结束";
}
else
ReTuen "":
}
------解决方案--------------------
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView dr = (DataRowView)e.Row.DataItem;
string starttime = dr["starttime"].ToString();
string endtitme = dr["endtitme"].ToString();
DateTime date = DateTime.Now;
//处理
e.Row.Cells[0].Text = "dd";
}
}