473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Container.DataItem not displaying

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
Nov 19 '05 #1
1 983
"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Thanks,

Tom

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: az bij | last post by:
Hi, I have a dataset bound to a repeater and want to place some logic in my ascx file. I want to display an image link if and only if an image is available. I have tried without success...
1
by: Mike P | last post by:
I'm having trouble with C# syntax for Container.DataItem. This is the VB version. CAn anybody help me out with the syntax? <asp:DataList runat="server" id="dlResults" Font-Name="Verdana"...
1
by: Chris Fink | last post by:
Hi, My question is how do I set some text within my datalist itemtemplate to be bold, based on the higher value of two bound data items? For example, if the value of <%#...
5
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash...
2
by: marcus.lecount | last post by:
Hi to anyone out there that is taking the time to read this. I'm new to ..net and any help given is appreciated. I am displaying a datalist on a page and I want to limit the length of the...
0
by: John Davis | last post by:
Hi all, hope you are well. I would like to know if I can access the strongly typed properties of my datatable when binding through the ObjectDataSource object. I am currently creating some...
0
by: John Davis | last post by:
Hi all, hope you are well.(not sure if this posted the first time) I would like to know if I can access the strongly typed properties of my datatable when binding through the ObjectDataSource...
5
by: .Net Sports | last post by:
I'm having problems trying to get a record out of a resultset when working with a Datalist control. <%# Container.DataItem( "myfield" )%is how I am displaying the field , but when trying to do an...
3
by: alberthung01 | last post by:
Hi all, I try to use Container.DataItem() in my DataGrid's ItemTemplate. Somewhere it works fine. eg.<input type=checkbox id='cb_select_<%# Container.DataItem("TAG_ID") %>' value='<%#...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.