检查Empty DataList [英] check Empty DataList

查看:83
本文介绍了检查Empty DataList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET和VB来显示消息(标签),而datalist是这样的空的

I am using ASP.NET and VB to display a message(label) while the datalist is empty like this

展开 | 选择 | 换行 | 行号

推荐答案


可见=''<%#bool.Parse((dlErgebnis.Items.Count == 0).ToString() )%>
Visible=''<%#bool.Parse((dlErgebnis.Items.Count==0) .ToString()) %>



这是你犯下最大错误的地方....


你可以通过三元组做同样的事情像这样的运算符

this is where you''re commiting the biggest mistake....

You can do the same via ternary operator like this

展开 | 选择 | Wrap | 行号


Hallo Thatthatguy,


我试过你说我得到的错误如下所示:
类型System.String的错误1对象不能从其字符串表示''%(== 0)中删除dlErgebnis.Items.Count?真:假;%>对于要创建的Visible属性。


谢谢。


sarab
Hallo Thatthatguy ,

I have tried as you said iam getting the error as below

Error 1 object of type System.String can not dlErgebnis.Items.Count from its string representation ''% (== 0)? True: false;%> for the Visible property to be created.

Thank you .

sarab


试试这个

Try this

展开 | 选择 | Wrap | 行号


这篇关于检查Empty DataList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆