What is the difference between Panel and PlaceHolder in ASP.NET?
A panel expands to a span (or a div), with it's content within it. A placeholder is just that, a placeholder that's replaced by whatever you put in it.
Hey ansh
The Placeholder does not render any tags for itself, so it is great for grouping content without the overhead of outer HTML tags.
The Panel does have outer HTML tags but does have some cool extra properties.
BackImageUrl: Gets/Sets the background image's URL for the panel
HorizontalAlign: Gets/Sets the
horizontal alignment of the parent's contents- Wrap: Gets/Sets whether the
panel's content wraps
There is a good article at startvbnet here.
PlaceHolder control:
Use the PlaceHolder control as a container to store server controls that are dynamically added to the Web page. The PlaceHolder control does not produce any visible output and is used only as a container for other controls on the Web page. You can use the Control.Controls collection to add, insert, or remove a control in the PlaceHolder control.
Panel control:
The Panel control is a container for other controls. It is especially useful when you want to generate controls programmatically, hide/show a group of controls, or localize a group of controls.
The Direction property is useful for localizing a Panel control's content to display text for languages that are written from right to left, such as Arabic or Hebrew.
The Panel control provides several properties that allow you to customize the behavior and display of its contents. Use the BackImageUrl property to display a custom image for the Panel control. Use the ScrollBars property to specify scroll bars for the control.
Render:
PlaceHolder control will render noting, but Panel control will render as a DIV.
More information, please see the following links:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.placeholder.aspx (PlaceHolder Class)
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.panel.aspx (Panel Class)