ControlBuilders and Templates

G

Geoff Taylor

Hi,

OK, so no-one can answer the question below. That's OK, it's pretty
complicated. But can anyone point me at a mailing list or newsgroup
that might be able to answer or help?

Cheers,

Geoff

-------- Original Message --------
Subject: ControlBuilders and Templates
Date: Sat, 01 Nov 2003 19:06:17 +0000
From: Geoff Taylor <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols

Hi,

How do I run a ControlBuilder inside a template?

Say I have a tag derived from DataList. I want to be able to use the
ControlBuilder to allow the page developer to use special tags. For
example:

<opgeek:Tasks runat="server" ...>
<ItemTemplate>
<TaskLink><Title/><TaskLink>
<br />
Due: <b><DueDate/></b>
</ItemTemplate>
</opgeek:Tasks>

I can happily use a ControlBuilder to interpret TaskLink, Title, etc. if
they're inside a control of mine (I just set the
ControlBuilderAttribute). But I can't figure out how to do it if the
tags are within a template such as ItemTemplate.

Any ideas?

Geoff
 
G

Geoff Taylor

Alessandro said:
hi Greoff, its very simple actually, look at the last example on this link.
http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=/quicksta
rt%2faspplus%2fdoc%2fwebctrlauthoring.aspx

The example you want to look at is the last one, titled : Defining a Custom
Control Builder :)

Hi,

thanks for that, but the default use of the ControlBuilder won't quite
do what I want. The problem is that the inner content I want to apply
the ControlBuilder to isn't a direct child of my control - it's inside
an ItemTemplate.

So, in the code:

<opgeek:Tasks runat="server" ...>
<TaskLink><Title/><TaskLink>
<br />
Due: <b><DueDate/></b>
</opgeek:Tasks>

TaskLink could be intercepted and mapped by a ControlBuilder just fine.
But in the code:

<opgeek:Tasks runat="server" ...>
<ItemTemplate>
<TaskLink><Title/><TaskLink>
<br />
Due: <b><DueDate/></b>
</ItemTemplate>
</opgeek:Tasks>

TaskLink is never passed to my ControlBuilder here, because it's inside
the ItemTemplate.

Thanks anyway,

Geoff
 

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,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top