Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Templated control question

Templated control question

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestioncsharphtml
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lustuyck
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups