How to change the contentplaceholder bgcolor using Theme skin file?

Last post 12-19-2005 5:40 PM by jasonli. 3 replies.

Sort Posts:

  • How to change the contentplaceholder bgcolor using Theme skin file?

    12-12-2005, 11:04 AM
    • Participant
      1,191 point Participant
    • jasonli
    • Member since 08-03-2005, 3:23 PM
    • Posts 268

    I have a master page which contains one contentplaceholder. I want to use theme skin file to control the background color of the contentplaceholder, how can I do it in the skin file?

    It skin file works fine for other web controls. But because the skin edit window doesn't provide intellicense feature, so I cannot figure it out.

    Thanks,

     

  • Re: How to change the contentplaceholder bgcolor using Theme skin file?

    12-12-2005, 1:20 PM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    The conentplaceholder is only a "marker" where the content from the conent page will be added, so you can't add a conentplaceholder to the .skin file.
    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
  • Re: How to change the contentplaceholder bgcolor using Theme skin file?

    12-15-2005, 10:09 AM
    • Member
      35 point Member
    • bassham
    • Member since 11-08-2005, 3:21 PM
    • Posts 7

    Since you can't set the background color of the contentplaceholder control, do it like this:

    <div class="contentplaceholder1">
       <asp:contentplaceholder ...>
       </asp:contentplaceholder>
    </div>

    Then you can just add a class to your style.css file in the theme directory:

    .contentplaceholder1
    {
       background-color: red
    ;
    }

    The contentplaceholder control is just what it says, it just holds a spot for something else to go in, the control itself never actually renders anywhere.  Hope this helps.

    Rick Bassham

  • Re: How to change the contentplaceholder bgcolor using Theme skin file?

    12-19-2005, 5:40 PM
    • Participant
      1,191 point Participant
    • jasonli
    • Member since 08-03-2005, 3:23 PM
    • Posts 268

    Thanks for both of you.

    I did it another way. I put the contentplaceholder on a panel. Beacause I can control the panel background in the skin file. So if the panel background changes, the background of the contentplaceholder will change.

Page 1 of 1 (4 items)