<%# Eval("[title]") %>左边数起取位数
以前ASP里有个left函数
<% title = rsnew("title")
if len(title) > 18 then
response.write(Left(title,18))+"…"
else
response.write(title)
end if
%>
.net不知道该怎么用?求助
以前ASP里有个left函数
<% title = rsnew("title")
if len(title) > 18 then
response.write(Left(title,18))+"…"
else
response.write(title)
end if
%>
.net不知道该怎么用?求助
解决方案 »
- IP来判断属于网通还是电信
- 使用web deploy 编译后部署报错“Could not load type '_Default'”,什么原因,如何解决?
- repeater控件绑定生成以后,如果想控制生成后的reapter中某一行的某个label控件该怎样编写代码
- 再问有关gridview问题 !!!!!!
- 求高人解释一段JS代码
- 一个困扰了我多天的问题????(asp.net c#)
- 高分求图片的一个解决方案
- 在深圳建立一个开发人员面对面的交流平台
- ASP.NET2.0中样式无法应用
- 一个菜鸟级的问题
- ASP.NET写的一个Web程序,出现“无法显示网页”的错误!
- datagrid怎么快速更新!
<%# Eval("[title]").ToString().Length>18? Eval("[title]").ToString().SubString(0,18)+"...":Eval("[title]").ToString()%>
FormatString()函数在后台处理;
{
if(title.length>18)
{
return title.Substring(0,17);
}
}
//或者使用后台方法:
<%# Gets(Eval("title")) %>//cs文件
public string Gets(object obj)
{
if (obj != null)
{
string title = obj.ToString();
if (title.Length > 18)
return title.Substring(0, 18) + "...";
else
return title;
}
return "";
}