SOS!!!怎样传参数到<%# DataBinder.Eval(Container.DataItem, "Col"+i.ToString())%> 在cs中Page_Load上面定义int i = 0;然后你循环里用不就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 add the code to the ItemDataBound event handler for the DataList:<td> <asp:Literal id=lit runat=server /></td>.......void Item_Bound(Object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Literal lit = (Literal)e.Item.FindControl("lit"); string s = ""; for(int i=1;i<=extCount;i++) { s += DataBinder.Eval(Container.DataItem, "Col"+i.ToString()).Tostring(); } lit.Text = s; } } panyee(快乐王子): 好像你那样不行,那样得到的只能是0,循环对他不起作用谢谢 saucer(思归, MS .NET MVP),我用你的方法试试,看看行不行 c# 应用程序在没有安装framework2.0情况下怎么运行 请教vs2008自带负载测试工具的使用 panel滚动条不正常 保存的时候自动获取后缀名 关于限制活动范围的实现 关于AD的dn问题。 如何加密解密字符串字段的值: C# ExpectedException 谁能解决这个难题呀???(C#) 请问C#都可以开发那些类型的应用? 请问有什么函数能从字符串中提出数字? 大侠进来帮助我设计设计这个,100相送,关于像使用值类型一样使用引用类型。
<asp:Literal id=lit runat=server />
</td>.......
void Item_Bound(Object sender, DataListItemEventArgs e)
{ if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{ Literal lit = (Literal)e.Item.FindControl("lit");
string s = "";
for(int i=1;i<=extCount;i++)
{
s += DataBinder.Eval(Container.DataItem, "Col"+i.ToString()).Tostring();
}
lit.Text = s; } }