Custom DataList Control

J

Jumping Matt Flash

I 've managed a workaround for the following problem but that in turn has
caused more problems so i'm looking for a better answer if possible.

Currently i have a data list which is required to display two table cells of
information. The first one being the first Field of a dataset and the second
with a textbox of the name of the second field (on the same row)

For example "select names, hobby from tblPeople"
would display

Bobby (a textbox named ASP)
Joe (a textbox named Java)

The main problem i've faced is when i use the following code an error is
returned stating "Container" not declared for the second DataBinder() line.

Code:

<itemtemplate>
<%# "<b>" _
& DataBinder.Eval(Contain.DataItem, "names") _
& "</b>"
%>
<input type = "textbox" name = "<%DataBinder.Eval(Contain.DataItem,
"hobby")%>">
</itemtemplate>


Using the following workaround i've managed to bypass this but encouter
another issue:

Code:

<itemtemplate>
<%# "<b>" _
& DataBinder.Eval(Container.DataItem, "Address Line") _
& "</td><td><input type=textbox name=" _
& DataBinder.Eval(Container.DataItem, "Address Value") _
& ">"
%>
</b>
</itemtemplate>


The problem is that i need to be able to custom validate these fields and as
they are dynamically drawn out VS 2003 kicks up a fuss when i try too(as
they haven't been created yet).

Hope thats not too confusing a description.

TIA
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top