asp.net数据绑定判断字段值是否为空

    xiaoxiao2026-05-25  6

    在用repeater或者其他数据控件时,如果想判断<%#Eval("id")%>这样的字段为空,可使用以下方法:

    <%# string.IsNullOrEmpty(Eval("id").ToString()) ? "" : Eval("id")%>

    转载请注明原文地址: https://ju.6miu.com/read-1310043.html
    最新回复(0)