What's the difference between PlaceHolder and <div />?

Posted by DaveDev on Stack Overflow See other posts from Stack Overflow or by DaveDev
Published on 2010-04-30T09:04:25Z Indexed on 2010/04/30 9:07 UTC
Read the original article Hit count: 145

Filed under:
|
|

In an ASP.NET project I have the following HTML:

<asp:PlaceHolder ID="plcTitle" runat="server"></asp:PlaceHolder>

<div id="divStrapline" runat="server" />

which are populated with this code:

if (this.TitlePanel != null)
{
    plcTitle.Controls.Add(this.TitlePanel);
}

if (this.Strapline != null)
{
    divStrapline.Controls.Add(this.Strapline);
}

Are they both the same thing? Is either better than the other? Why?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about html