receiving databound property data in a custom server control

D

Dirk Meusel

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
 
D

Dirk Meusel

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
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top