PlaceHolder

PlaceHolder

Previous Home Next

 

Use the PlaceHolder control as a container to store dynamically added server controls to the Web page. The PlaceHolder control does not produce any visible output and is only used as a container for other controls on the Web page. You can use the Control.Controls collection to add, insert, or remove a control from the PlaceHolder control.The PlaceHolder control is different from most other controls in that it remains invisible when added to a page. The purpose of a PlaceHolder control is to act as a container for other controls that are added to a web page.
The advantage of using this PlaceHolder is that the textbox, button and other content contained within the PlaceHolder opening and closing HTML tags are kept as a single entity. This pays dividends when the example search form is accessed programmatically through the code behind page.
The class hierarchy for this control is as follows:

Object
 Control
  PlaceHolder

The Panel control renders as a HTML div element whereas the PlaceHolder control does not render any HTML code

 
  

 

 PlaceHolder
*************************************************************************
*****
<%@ Page Language="C#" AutoEventWireup="True" %>




    PlaceHolder Example





   

PlaceHolder Example

Previous Home Next