asp.net Repeater绑定时使用函数
更新时间:2008年08月21日 21:31:29 作者:
asp.net repeater绑定函数使用实例
在后台cs文件中有个函数:
public string getStyle(object style)
{
if ((int)style == 1)
{
return "文字";
}
return "图片";
}
在前台的Repeater中要这样调用,
<%#this.getStyle(Eval("link_style"))%>
复制代码 代码如下:
public string getStyle(object style)
{
if ((int)style == 1)
{
return "文字";
}
return "图片";
}
在前台的Repeater中要这样调用,
复制代码 代码如下:
<%#this.getStyle(Eval("link_style"))%>
相关文章
asp.net MaxLengthValidator 最大长度验证控件代码
如果数据库字段为varchar或char类型,ASP.NET控件在可输入汉字的情况下,MaxLength属性不能保证在保存到数据库时不发生截断错误,因此写了一个最大长度验证控件,还可用于多行文本框。2009-12-12


最新评论