receiving databound property data in a custom server control

receiving databound property data in a custom server control

Post by dm2 » Thu, 14 Aug 2003 19:47:17


Hi,

Background:
I wrote a custom server control with a public property. Everything
works perfekt when I use that server control as following:

<DM:Visitenkarte id="Visitenkarte1" runat="server"
KontaktID="1"></DM:Visitenkarte>

Problem:
I would like to use my control within another. So, I thought of using
something like to receive in the public KontaktID a value from the
container control:

<DM:Visitenkarte id="Visitenkarte1" runat="server" KontaktID="<%#
Container.Dataitem("kontaktID") %>"></DM:Visitenkarte>

Question:
How can I manipulate my custom server control to receive the data from
the container control?

Dirk
 
 
 

receiving databound property data in a custom server control

Post by dm2 » Wed, 20 Aug 2003 18:54:02

hi,

I solved the problem, so no worries anymore. It's been a simple syntax error:

Instead of:
KontaktID="<%# Container.Dataitem("kontaktID") %>"

you've got to write
KontaktID='<%# Container.Dataitem("kontaktID") %>'

Dirk