473,407 Members | 2,312 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,407 software developers and data experts.

Obtain Data from Populated Repeater

Hi,

I am trying to extract the data from a repeater after a post.

This is my repeater.

<asp:Repeater ID="PreviousBuilds" Runat="server">
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "BuildNumber")
%></td>
</tr>
</ItemTemplate>
</asp:Repeater>

How can I get the values of "BuildNumber" from within my C# Code from
the repeater?
Thanks

Marcus de Leon

Feb 9 '06 #1
5 1243
Place it inside a label, such as

<asp:label id="BuildNumber" runat="server">
<%# DataBinder.Eval(Container.DataItem, "BuildNumber") %>
</asp:label>

and then you can loop through the items of your repeater and get the label
(and it's value)

foreach item as RepeaterItem in PreviousBuilds.Items
if item.ItemType = ListItemType.Item orelse item.ItemType =
ListItemType.AlternatingItem then
dim label as Label = ctype(item.FindControl("BuildNumber"), Label)
'you can get the buildnumber for this row from label.Text
end if
next

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"madfisher" <ma*******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,

I am trying to extract the data from a repeater after a post.

This is my repeater.

<asp:Repeater ID="PreviousBuilds" Runat="server">
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "BuildNumber")
%></td>
</tr>
</ItemTemplate>
</asp:Repeater>

How can I get the values of "BuildNumber" from within my C# Code from
the repeater?
Thanks

Marcus de Leon

Feb 9 '06 #2
Hi,

Thanks for your help.

I did this and I am getting empty strings for the label.Text value. Is
there anything else I need to do?

Feb 9 '06 #3
If your viewstate enabled?

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"madfisher" <ma*******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi,

Thanks for your help.

I did this and I am getting empty strings for the label.Text value. Is
there anything else I need to do?

Feb 9 '06 #4
I haven't changed anything in the viewstate. Would that be enabled by
default?

Feb 9 '06 #5
Yes, if you don't have EnableViewState="False" on the control or any parent
(including the page) it ought to be on by default.

You are doing this is a button's event handler, right? And you aren't
rebinding (ie, you are only calling DataSource and DataBind() if
!Page.IsPostBack)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"madfisher" <ma*******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I haven't changed anything in the viewstate. Would that be enabled by
default?

Feb 9 '06 #6

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

Similar topics

0
by: mark | last post by:
My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not...
2
by: John Holmes | last post by:
I am using radioButton controls in a data repeater and would like to incorporate the 'key' field into the 'id' attribute of the radioButton controls and name them something like: 'rad' + '<%#...
8
by: darrel | last post by:
*sigh*...I've asked this before, but have long forgotten the answer. In the past, I'd often use repeater controls, bind data to it, and then reference the data fields from within the repeater: ...
1
by: darrel | last post by:
I have a form that postsback to the server to update a DB table A. In this form I have a repeater that is populated from DB table B. Within this form, I have another button that, when clicked,...
7
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
3
by: gg77 | last post by:
Hi, I don't have much knowledge of the table control. I am basically trying to use a table thats populated with data rows from a dataSet but currently things aren't working for me. below is...
11
by: Doug Bell | last post by:
Hi, I am trying to create form that displays data like an Access continuous dataform rather than using a data grid. I am thinking that I can achieve this by creating a row of text boxes, one...
6
by: Milsnips | last post by:
hi there, i have a page with a repeater that is populated with my function called GetList, that returns an arraylist of my custom object, lets say its called Products{ProductID, Description,...
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.