一个label绑定一个bit数据,怎样使它在绑定true时显示为“是”?
解决方案 »
- 无法从“System.Data.DataSet”转换为“System.Collections.IEnumerable
- C#菜鸟,问一些C#类的语法问题
- 快要疯了 switch case 出现语法错误 ,"没有分号"
- gridview添加统计行
- Repeater的ItemDataBound为什么会少算一行?
- 帮帮忙乎
- 苦苦的寻求在VS2005下如何做网页的页面~~~:(分少没办法,只求好心人了```
- 页面中被注入ifram
- IIS相关问题.(超时时间已到。超时时间已到,但是尚未从池中获取连接。)
- 请问怎样把几个后台的cs文件变成dll?
- 我要导出真正的excel文件
- .net 1.1 使用ajaxpro 老出错 急啊
如:
pullic string formatYN(object str)
{
if(str.ToString() == "Ture")
{
return "是";
}
else
{
return "否";
}
}
if(bit数据)
{label.Text="是";}
else
{label.Text="否";}
要是在html中,那么可以些一个函数
public string tf(bool sf)
{
if(sf)
{return "是";}
else
{return "否";}}html调用<%# tf((bool)DataBinder.Eval(Container.DataItem, "bit")) %>
===
是在html中绑定的,怎样在html中写这个C#函数?
<%# (DataBinder.Eval(Container.DataItem, "bit"))?"是":"否" %>