<%#CutString(DataBinder.Eval(Container.DataItem,"title").ToString(),20)%>
///后台截取代码
public string CutString(string str,int length)
{
int i = 0, j = 0;
foreach(char chr in str)
{
i+=2;
if (i > length)
{
str = str.Substring(0, j-1);
break;
}
j ++;
}
return str;
}
///后台截取代码
public string CutString(string str,int length)
{
int i = 0, j = 0;
foreach(char chr in str)
{
i+=2;
if (i > length)
{
str = str.Substring(0, j-1);
break;
}
j ++;
}
return str;
}