Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've been working on a custom templated web control and wondering if it woukd be possible to create a complex control whereby one template provides the field for another. For example:

 

<asp:controlname>

<Template1>

<div><%# Container.Template2Data %></div>

</Template1>

<Template2>

<b><%# Container.Item %></b>

</Template2>

</asp:controlname>

 

So template 1 is used multiple times with some source data and then the items genarated from this are placed in the Template2Data fields in the first template.

 

Is this possible?

 

:)

Please check the Knowledge Base before you post.

"Computers are useless. They can only give you answers." - Pablo Picasso

The Code Net

  • 2 weeks later...
Posted

Just a follow up - I've still not worked out if this is possible but I'm thinking it's probably not - I can't think of a way of doing it really unless I could get the HTML out of the evaluated template..

 

(Some may have noticed the typo in the above - it should clearly say:

 

So template 2 is used multiple times....)

 

In the end I built my own template control by parsing my own templates where all the fields looked like:

 

[DataItem]

 

Works fine as I'm pullign the templates from a DB but obviously I couldn't use it as with a standard tmeplated control by typing the HTML into the page.

 

:)

Please check the Knowledge Base before you post.

"Computers are useless. They can only give you answers." - Pablo Picasso

The Code Net

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...