Click here to Skip to main content
15,921,174 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using header template in an accordian as follows in the aspx page

XML
<HeaderTemplate>
   Project Name:
   <%#DataBinder.Eval(Container.DataItem, "ProjectName")%>
</HeaderTemplate>



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.
Posted
Updated 29-Sep-11 22:07pm
v2

1 solution

Hi,

try this for your requirement.

HTML
<% if (DataBinder.Eval(Container.DataItem, "ProjectName").ToString().Length > 0)
        {
        %>
          Project Name is : <%#DataBinder.Eval(Container.DataItem, "ProjectName") %>
        <%
        }
        else
        {
            %>
            No Records Found
            <%
        } %>



All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900