ContentPlaceHolder in MasterPage Header

Last post 03-16-2008 10:45 PM by Amanda Wang - MSFT. 3 replies.

Sort Posts:

  • ContentPlaceHolder in MasterPage Header

    03-13-2008, 4:43 PM
    • Member
      28 point Member
    • ShijuKadamala
    • Member since 01-25-2008, 2:55 PM
    • Tampa
    • Posts 17
    In visual studio 2008, MasterPage has a section ContentPlaceHolder in the header. What is the use of that section?

    Thanks in advance

     

     

  • Re: ContentPlaceHolder in MasterPage Header

    03-13-2008, 5:42 PM
    • Participant
      1,086 point Participant
    • tmpuzer
    • Member since 03-07-2008, 5:45 PM
    • Posts 462

     I haven't used VS2008 but my guess is that the purpose of this is so that you can place meta tags (or anything else you might typically put in the html header section) that are related to your content page.

     
    Example:

    <asp:Content ID="HeaderContent" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

     <meta name="keywords" content="keyword1, keyword2, ..., keywordN" />

    </asp:Content>
     

    If a post helps me I'll always eventually mark it as an answer. But I frequently don't mark it right away because I feel once a thread is marked as answered, discussion tends to end. And I like to discuss things a bit.
  • Re: ContentPlaceHolder in MasterPage Header

    03-13-2008, 6:06 PM
    • Member
      325 point Member
    • komakula
    • Member since 03-10-2008, 2:19 PM
    • Posts 187
  • Re: ContentPlaceHolder in MasterPage Header

    03-16-2008, 10:45 PM
    Answer

    Hi,

    The contentplaceholder in the header section is used to add additional tags inside head, like <meta> and <link> for the content page. Which can be specific to the content page, and we wouldn’t want to include them in the .master for every page.

    The details you can see this link: http://odetocode.com/Blogs/scott/archive/2006/04/10/3258.aspx

     

    Hope it helps.

    Amanda Wang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)