asp.net Repeater绑定时使用函数
(编辑:jimmy 日期: 2024/5/20 浏览:3 次 )
在后台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(c#)利用构造器链的代码