Container.DataItem not displaying

  • Thread starter Thread starter tshad
  • Start date Start date
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
 
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

Back
Top