473,465 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataBinding with Array

I've got following problem:
I need to present an Array of strings and want to Present it in an
DataRepeater.
the Code is like this (in C#):

string[] NameList = SomeClass.GetNameList();
MyRepeater.DataSource = NameList;

Now I don't know, how I con declare the databinding, it should be something
like this:

<asp:repeater id="MyRepeater" runat="server">
<ItemTemplate>
.....
<asp:Label Text='<%# DataBinder.Eval(Container.DataItem, ???? ) %>
/>
......
</ItemTemplate>
......
</asp:repeater>

Thanks
cn
Nov 17 '05 #1
1 3510
Try using just <%# Container.DataItem %>

"Christof Nordiek" <cn******@amexus.com> wrote in message
news:bd*************@news.t-online.com...
I've got following problem:
I need to present an Array of strings and want to Present it in an
DataRepeater.
the Code is like this (in C#):

string[] NameList = SomeClass.GetNameList();
MyRepeater.DataSource = NameList;

Now I don't know, how I con declare the databinding, it should be something like this:

<asp:repeater id="MyRepeater" runat="server">
<ItemTemplate>
.....
<asp:Label Text='<%# DataBinder.Eval(Container.DataItem, ???? ) %> />
......
</ItemTemplate>
......
</asp:repeater>

Thanks
cn

Nov 17 '05 #2

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

Similar topics

0
by: Jason S | last post by:
I haven't been able to get an answer to this in the asp.net group, hoping someone here can enlighten me. As pertains to databinding a control in a repeating fashion(datagrid, repeater, etc.)...
1
by: D. Shane Fowlkes | last post by:
This should be easy but I'm having a little trouble connecting the logical dots. I have a function which simply returns the 12 month names. Whoopie. I'm trying to store that data into an...
4
by: Jim Heavey | last post by:
I have a book which shows that I can do Databinding to a control like the following: <asp:Label ID="lblScorecardCmntCategory" Runat="server" text='<%# Container.DataItem("Name") %>'></asp:Label>...
3
by: Kevin Swanson | last post by:
I'm writing what should be a very simple app against an Oracle database. The app has a number of user controls, any one of which is loaded into a main display page using the loadControl method,...
1
by: Andy Fish | last post by:
Hi, Say I have an Array of "Person" objects that I'm using as the DataSource for a grid control. At databinding time I'd like to select only people with age>18 to go into the grid and ignore all...
2
by: Mr Newbie | last post by:
Ive got the basic idea behind DataBinding Expressions, but I have a couple of questions, Ok its four actually :) Q1.) It would appear that if you use Page.DataBind that all child controls and...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
5
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
8
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.