asp.net Repeater绑定时使用函数
来源:动视网
责编:小采
时间:2020-11-27 22:45:03
asp.net Repeater绑定时使用函数
asp.net Repeater绑定时使用函数:在后台cs文件中有个函数: 代码如下:public string getStyle(object style) { if ((int)style == 1) { return 文字; } return 图片; } 在前台的Repeater中要这样调用, 代码如下:<%#this.getStyle(Eval(link_
导读asp.net Repeater绑定时使用函数:在后台cs文件中有个函数: 代码如下:public string getStyle(object style) { if ((int)style == 1) { return 文字; } return 图片; } 在前台的Repeater中要这样调用, 代码如下:<%#this.getStyle(Eval(link_

在后台cs文件中有个函数:
代码如下:
public string getStyle(object style)
{
if ((int)style == 1)
{
return "文字";
}
return "图片";
}
在前台的Repeater中要这样调用,
代码如下:
<%#this.getStyle(Eval("link_style"))%>
asp.net Repeater绑定时使用函数
asp.net Repeater绑定时使用函数:在后台cs文件中有个函数: 代码如下:public string getStyle(object style) { if ((int)style == 1) { return 文字; } return 图片; } 在前台的Repeater中要这样调用, 代码如下:<%#this.getStyle(Eval(link_