Accordian标头模板问题 [英] Accordian header template issue
本文介绍了Accordian标头模板问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在aspx页面中按如下方式在Accordian中使用标题模板
Hi,
I am using header template in an accordian as follows in the aspx page
<HeaderTemplate>
Project Name:
<%#DataBinder.Eval(Container.DataItem, "ProjectName")%>
</HeaderTemplate>
我需要检查模板中的值,如果它为null,那么我需要显示未找到记录"消息,否则将项目名称绑定.
请帮忙.
I need to check the value in the template , if its null then i need to display "no records found" message, else the projectname as binded.
Please help.
推荐答案
根据您的要求尝试一下.
Hi,
try this for your requirement.
<% if (DataBinder.Eval(Container.DataItem, "ProjectName").ToString().Length > 0)
{
%>
Project Name is : <%#DataBinder.Eval(Container.DataItem, "ProjectName") %>
<%
}
else
{
%>
No Records Found
<%
} %>
最好的
All the Best
这篇关于Accordian标头模板问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文