Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How do I refer to data from nested web user control?

Thread Tools

How do I refer to data from nested web user control?
Posts: n/a
How do i perform a databind on a web user control within a repeater or
how can I access the datasource that is already bound? I have a web user
control that displays a table of values (the profile of a piece of
from SQLServer. I've used a repeater on the webform since a query (i.e. by
address) against the DB may return multiple machine profiles and I want to
use the repeater to display as many machine profiles as are returned by the

for each field in on the web user control I've tried using something like
the following to access each field value:

DataBinder.Eval(Container.DataItem, "Name")
(where FIELD_NAME is the name of the column I'd like to reference.)

This method will work if I place the repeater on the web user control (and
make it public or create a property for its datasource) rather than the
webform but what I'd like to do is to create the repeater control on my
webform and then include the webusercontrol inside the repeater's item
template. However, when I do this the above method for refering to the
value no longer works. I get error messages saying that container is not a
member of web.ui.controls. I found a semi-relavent posting which suggested

DataBinder.Eval(Container, "DataItem.FIELD_NAME")

However this does not work either. How can this be achieved?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to refer to method in nested class? Java 2 06-28-2007 02:17 PM
How do I refer to data from nested web user control? ASP .Net 0 05-19-2005 11:25 PM
can't refer to nested frame George Sicherman[aes] MTD43D29 Javascript 1 10-12-2004 09:43 PM
How do you refer to a textbox that is located in a User Control? Mike Hnatt ASP .Net 6 10-23-2003 04:41 AM