Basics: Panel VS Placeholder (ASP.NET)

One more thing to keep in mind when working with ASP.NET is the difference between the two most commonly used controls to add other controls in a specific position on a page.

The main differences are:

1. A panel expands to a span (or a div), with its content within it. ie. all controls that reside inside a panel, will be inside a span or a div in the HTML source code of the page. On the other hand, a placeholder is just a placeholder that’s replaced by whatever you put in it. There will be no added markup around your controls. The controls that reside within the placeholder in your ASP.NET code, will replace the placeholder on the HTML source code.

2. A panel will have some extra properties: BackImageUrl (to get or set an image as a background for the panel), HorizontalAlign (to get or set the horizontal alignment of the parents’ contents), Wrap (to get or set the panel’s content wraps).

3. Possibly, the most important feature for a panel is the DefaultButton. This will define which event to fire when the ENTER button is pressed. Very useful when dealing with various panels and buttons.

For more information, visit MSDN:

PlaceHolder Class / Panel Class

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.