User Control DataBind!

M

Mr Ideas Man

Hi,

I have a DataList..that contains a Template like so.
This template contains a user control:
This control has a property, that retrieves it value from the DataSource
associated with the DataList.

<ItemTemplate>
<MyControl:Test ID="myControl" intID="<%# Container.Dataitem("myID")%>"
Runat="server"/>
</ItemTemplate>

Problem:
When calling the User Controls DataBind method, the property in question
(intID="<%# Container.Dataitem("myID")%>") is causing an error:
System.NullReferenceException: Object variable or With block variable not
set.

Can anyone help me fix!!!


Cheers,
Adam
 

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

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top