我用repeater来帮定数据,
<itemtemplate>
<%#DataBinder.Eval(Container.DataItem,"lanmu_num")%>
</itemtemplate>
以上都正确,
当我现在想当帮定的"lanmu_num"值大于1000时显示new图片
我用:if((int)DataBinder.Eval(Container.DataItem,"lanmu_num") >1000)
{}时提示错误:container没有定义,加了<%@ Import namespace="System.Data"%>
<%@ Import namespace="System.Data.SqlClient"%>也不可以,请问是怎么回事啊,或者还有没有更好的方法呢?
<itemtemplate>
<%#DataBinder.Eval(Container.DataItem,"lanmu_num")%>
</itemtemplate>
以上都正确,
当我现在想当帮定的"lanmu_num"值大于1000时显示new图片
我用:if((int)DataBinder.Eval(Container.DataItem,"lanmu_num") >1000)
{}时提示错误:container没有定义,加了<%@ Import namespace="System.Data"%>
<%@ Import namespace="System.Data.SqlClient"%>也不可以,请问是怎么回事啊,或者还有没有更好的方法呢?
解决方案 »
- session问题
- 无刷新界面制作...
- 急急急!求助:文件是以二进制形式存入数据库的,如何实现数据库中文件的下载功能
- DataGrid如何使某些行不显示删除按钮,某些行显示删除按钮?
- 这里提示"c:\inetpub\wwwroot\Weblog\Entry.cs(15): 类、结构或接口成员声明中的标记“;”无效,如何修改啊!在线等!!
- ASP.NET 的MSN群组
- 100分求购asp.net在线编辑器
- DataGrid中怎么根据其中两列的值来得到另外一列的值
- DropDownList只能用手写代码绑定数据??这方法好土呀...
- 请高手解释下这什么意思
- 请教学习.net要看点什么书,请高手推荐几本。
- insert into为什么没有数据插入?谢谢
<%# Convert.ToInt16(DataBinder.Eval(Container.DataItem,"lanmu_num")) >1000 ? "aaa.gif":"bbb.gif" %>
你的方法可行,但当大于多项时,怎么用if语句啊
{
string pic1 = "aaa.gif"
string pic2 = "bbb.gif"
//........ if(num>10)
{
return pic1;
}
else if(num>100)
{
return pic2;
}
//..........
}