mark007 Posted April 25, 2005 Posted April 25, 2005 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? :) Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
mark007 Posted May 4, 2005 Author Posted May 4, 2005 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. :) Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.