Container.DataItem not displaying

T

tshad

If I have this statement:

<asp:Label ID="Days" Text='<%#
Container.DataItem("NumberOfDays")%>runat="server"/>

It it displays the data coming from my Sql statement (a number - 30, 60,
etc).

If I add the text " Day" to it (so that it would display - 30 Day, 60 Day
etc), it doesn't display the data I got from the Sql statement. It only
displays "Day" in each row.

How do I get it display both?

Thanks,

Tom
 
T

tshad

tshad said:
If I have this statement:

<asp:Label ID="Days" Text='<%#
Container.DataItem("NumberOfDays")%>runat="server"/>

It it displays the data coming from my Sql statement (a number - 30, 60,
etc).

If I add the text " Day" to it (so that it would display - 30 Day, 60 Day
etc), it doesn't display the data I got from the Sql statement. It only
displays "Day" in each row.

How do I get it display both?

Figured it out.

It should have been:

Text='<%# Container.DataItem("NumberOfDays") & " Day"%>'

Where " Day" is inside the <%# %> tags.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top