Advertisements

Coud you use a PlaceHolder control and dynamically add a linkbutton control
to it? You could set the URL and target properties before adding the control
to the PlaceHolder controls collection.

Just an idea.

"Casper Hornstrup" <> wrote in message
news:...
>I need to make a control that can be used like this:
>
> <csite:LocalizedHint id="hint1" runat="server">
> <csite:Target>
> <a href="http://whereever.net"> my text</a>
> </csite:Target>
> <csite:Source>
> <div class="special1">Click me!</div>
> </csite:Source>
> </csite:LocalizedHint>
>
> Target and Source should be able to contain any controls and literal
> content.
> I, however, get the following parser error:
>
> Type 'Localization.Target' does not have a property named 'a'.
>
> How do I change Target and Source to accept anything?
>
> Casper
>
>

hi casper, what you need to do is create two templates, in your case a target and a source template. Its actually very simple, heres an example from the docs.
what you do is define a template and child controls are in turn defined inline within this template. Dont forget to specify ParseChildren(true) on your main class. Its there on the examples

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!