日期:2014-05-19  浏览次数:20428 次

DataList中的FindControl问题!!
dl_CommendVedio已绑定了数据,可是在FindConttrol中却不到lbl_SVedio;
注:前台有id   为   lbl_SVedio的label
for(int   i   =   0   ;   i   <   dl_CommendVedio.Items.Count     ;   i   ++   )
{
      Label   TempLabel   =   (Label)dl_CommendVedio.Items[i].FindControl( "lbl_SVedio ");
if(TempLabel.Text.Length   >   10   )
{
TempLabel.ToolTip   =   TempLabel.Text;
TempLabel.Text   =   TempLabel.Text.Substring(0,10)   +   "..... "   ;
}
} }

------解决方案--------------------
http://community.csdn.net/Expert/topic/5410/5410473.xml?temp=.9266626
或试试强制转换