DataRowView dv = ((DataRowView)e.Item.DataItem);
经查,解决方法如下 :
原来:
protected void Repeater5_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView dv = ((DataRowView)e.Item.DataItem);
((Literal)e.Item.FindControl("Feeds")).Text = dv.Row["Types"].ToString() + "xxx";
}
}
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView dv = ((DataRowView)e.Item.DataItem);
((Literal)e.Item.FindControl("Feeds")).Text = dv.Row["Types"].ToString() + "xxx";
}
}
改为:
protected void Repeater5_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Bangso.Module.Feeds dv = (Bangso.Module.Feeds)e.Item.DataItem;
((Literal)e.Item.FindControl("Feeds")).Text = dv.Types + "xxx";
}
}
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Bangso.Module.Feeds dv = (Bangso.Module.Feeds)e.Item.DataItem;
((Literal)e.Item.FindControl("Feeds")).Text = dv.Types + "xxx";
}
}