Results 1 to 4 of 4

Thread: Placeholder

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    33

    Placeholder

    Recently I placed some threads (questions) about creating
    controls (dynamic) on a webform.
    I received a useful tip to use a placeholder.
    With this in mind , it is not very difficult to create controls from a xml file. But there is one big problems left :

    When I add two labels to the placeholder they are placed next to each other. I want the second label on the next rule.
    Is this possible? And are there other ways to place created controls at an exact location on the form?

    greetings,

    Krol

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    When I add two labels to the placeholder they are placed next to each other. I want the second label on the next rule.
    To solve this problem, it is pretty easy. I assume you are adding the controls to the placeholders control collection. If you are doing that, you just need to add a control between them. That control would be a literalcontrol with a br tag as the text:
    Code:
    LiteralControl lc = new LiteralControl("<br>");
    Now, add lc in the placeholders control collection between the two label controls. This will put a line break in.

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    33

    Thumbs up

    Thanks! It works!!!!
    If you want to add multiple <br> at the placeholder and only
    want to declare 1 literal you have to change the id of the
    declared literal and then add it to the placeholder.
    If you don't change the id, only one literal is added.
    I seems logic, but it kept me puzzling for a minute..


    Krol

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You can put any html and/or text in the literalcontrol:
    LiteralControl lc = new LiteralControl("<br><br>");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width