473,387 Members | 3,801 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,387 software developers and data experts.

Reference repeater data

Hey all-

I'm new to asp.net so please bear with me -- I'm attempting to
reference the repeater's Container.DataItem outside the repeater
object.

In other words -- In a seperate sub routine: if the repeater's
Container.DataItem == Something -> Do Action. How do I reference the
Container.DataItem in by sub routine (And thus outside the repeater
object)?

Thanks!

Nov 19 '05 #1
4 1469
Hi,

from where do you call the subroutine or it gets called? If that Do Action
is your subroutine, couldn't you just apss reference to it. Anyways, please
provide a bit more details.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
Nov 19 '05 #2
The repeater is obivously part of the html code - I'd like to reference
the Container.DataItem from the vb.net code from above. I can reference
the repeater object just find - I just can't get to the
Container.DataItem from the repeater object. Is this possible?

-Joel

Nov 19 '05 #3
I see,

Container.DataItem is available only inside Repeater's template and only for
the request after DataBound is called. In practise means that you'd access
it from Repeater's ItemDataBound event in addition to the template itself
(e.g meaning that template accesses it via databinding expressions). So in
that sort it's not available. Repeater and itas child controls (in
templates) only have knowledge of its data and access to it

However, if you bind the Repeater say to a DataTable or a DataSet, you could
have the data source object (ds/dt) available via a public member on the
code-behind class so that repeater can bind to it, but the data is also
consumable. Means that you have a public member on the class, and you load
the dt(ds to it with ADO.NET). Repeater is then just one consumer for the
data. Or not being the only option, you could just access the data in
Page_Load etc before you bind the dt/ds to repeater and set Text's of
Label's and textBoxes before binding etc etc. Possibilities are endless.

If you want more concrete help, provide a sample of your code & scenario.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #4
Thanks for the assistance - I was able to access the data using the ds
object. Thanks!!

Nov 19 '05 #5

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

Similar topics

0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
6
by: Tom Kaminski [MVP] | last post by:
On my code behind page, how can I reference a Label control that's included in a Repeater? In other words, given: <asp:Repeater id="Repeater1" runat="server"> <HeaderTemplate> <table> <tr>...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
1
by: fredda054 | last post by:
Hi everybody ! With help from some nice people here I'm getting close to solve my problem with dbnull values in a repeater. I got it pretty much done, I just ned to fix some syntax. I get a...
2
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: ...
3
by: renil | last post by:
I have a repeater control that displays info. from a datatable. Each row in the repeater has a checkbox. Also, I have a delete linkbutton outside the repeater control. What I'm trying to do when...
2
by: shapper | last post by:
Hello, I created a Repeater at runtime with an AccessDataSource.Everything Works fine! Now I need to use the same repeater but with a DataSource created in my VB.Net code. I created a...
2
by: AC [MVP MOSS] | last post by:
I have a repeater with a header, footer, and item template. The item template is the only one with server controls (hyperlinks, labels, and a nested repeater). Within the top repeater, I'm handling...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.