Groups | Blog | Home
all groups > asp.net building controls > august 2003 >

asp.net building controls : receiving databound property data in a custom server control


dm2 NO[at]SPAM rcs.urz.tu-dresden.de
8/13/2003 3:47:17 AM
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?

dm2 NO[at]SPAM rcs.urz.tu-dresden.de
8/19/2003 2:54:02 AM
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

[quoted text, click to view]
AddThis Social Bookmark Button