Templated control question
-
I created a templated control exactly as described on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomizingcontrolswithtemplates.asp[^] The result for the moment is http://www.coders-lab.net/index.aspx?sm=myweblog[^] (only show/hide comments works). All it does is using a template to generate the layout and fill in data from the database. Template looks like (simplified, but you'll get the idea):
<CC:WebLog runat="server">
<TopicRepeaterTemplate>
<h1><% #Container.Title %></h1>
<h3><% #Container.Author %></h3>
<a href="<% #Container.PostCommentHyperLink%>">Post comment</a>
</TopicRepeaterTemplate><CommentRepeaterTemplate>
<h1><% #Container.Title%></h1>
<CommentRepeaterTemplate></CC:WebLog>
Then I started with the 'post comment' link implementation, and that's where I'm stuck. I want to create another template that determines the layout of the post comment part:
< PostCommentTemplate>
<RR:FreeTextBoxControl runat="server" id="CommentEditor">
<a href="<% #Container.InsertCommentHyperLink%>">Post comment</a>
</PostCommentTemplate>I want the user to be able to add an editor control in the template with id="CommentEditor" (for example the FreeTextBoxControl). But I don't know how to generate this in my WebLog control, and after clicking on the 'Post comment' hyperlink I need to retrieve that control again in order to get the value of it. So replacing <%#%> tags in the template works; but now I need to find out how I can place custom controls on the template, and use them in my WebLog control... Can someone point out how this can be done? Thanks, kind regards, Ludwig