Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

How do I refer to data from nested web user control?

 
 
news_server.nc.rr.com
Guest
Posts: n/a
 
      05-19-2005
How do i perform a databind on a web user control within a repeater or
rather
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
equipment)
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
DB.

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
field
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
I
use:

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

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


 
Reply With Quote
 
 
 
Reply

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
How to refer to method in nested class? aaronfude@gmail.com Java 2 06-28-2007 02:17 PM
How do I refer to data from nested web user control? news_server.nc.rr.com ASP .Net Web Controls 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
User Control needs to refer to Page Joe Fallon ASP .Net 5 02-12-2004 03:28 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



Advertisments