The placeholder control is plainly the dynamic addition of a user control.
When you convert from one Web page to another, some parts of your ASP. NET application's user interface are often the same--such as some "decorative" parts: a GIF picture at the header, a horizontal toolbar or a navigation bar, a link to the left, and so on. You can continue to use them without having to rebuild each page.
Sometimes the project needs to dynamically generate some controls on the page, so the placeholder container is a good choice. Microsoft's placeholder solution in ASP. NET 2.0 is more consistent with the principle of background and performance separation;
You can add any HTML control, even JavaScript code, to placeholder during your actual use.
This basically satisfies the problem that JavaScript needs to appear in a particular location;
Use the PlaceHolder control as a container to store server controls that are dynamically added to a Web page. The PlaceHolder control does not produce any visible output and can only be used as a container for other controls on a Web page. You can use the Control.Controls collection to add, insert, or remove controls in a PlaceHolder control.
<asp:placeholder id= "Placeholderinsurancegrid" runat= "Server" ></asp:PlaceHolder>
PlaceHolderInsuranceGrid.Controls.Clear ();
Insurancegrid Grid = Page.LoadControl ("~/xxx.ascx") as Insurancegrid;
PLACEHOLDERINSURANCEGRID.CONTROLS.ADD (GRID);
Grid. LoadData (Employeeno, Transferid, companylogoid);
Placeholder controls
Describe
New
<asp:contentplaceholder id= "Placeholderquicklaunchtop" runat= "Server" >
The top of the Quick Launch menu.
Is
<asp:contentplaceholder id= "Placeholderquicklaunchbottom" runat= "Server" >
Quick Start menu at the bottom.
Is
<asp:contentplaceholder id= "Placeholderpagetitle" runat= "Server"/>
The title of the site.
Whether
<asp:contentplaceholder id= "Placeholderadditionalpagehead" runat= "Server"/>
Placeholder for the head section of the page to add extra such as ECMAScript (Javascript,jscript) and cascading style sheets (CSS) to the head tag of the HTML corresponding to the page.
Whether
<asp:contentplaceholder id= "Placeholderbodyareaclass" runat= "Server"/>
The class in the body area.
Whether
<asp:contentplaceholder id= "spnavigation" runat= "Server" >
This control is used to place controls on the page editing class.
Whether
<asp:contentplaceholder id= "PlaceHolderSiteName" runat= "Server" >
The name of the site where the current page is located.
Whether
<asp:contentplaceholder id= "Placeholderpagetitleintitlearea" runat= "Server"/>
The title of the current page that appears in the title area.
Whether
<asp:contentplaceholder id= "placeholderpagedescription" runat= "Server"/>
The description of the current page.
Whether
<asp:contentplaceholder id= "Placeholdersearcharea" runat= "Server" >
The location in the page where the search control is placed.
Whether
<asp:contentplaceholder id= "placeholderglobalnavigation" runat= "Server" >
The breadcrumb control on the page.
Whether
<asp:contentplaceholder id= "Placeholdertitlebreadcrumb" runat= "Server" >
The breadcrumb text on the breadcrumb control.
Whether
<asp:contentplaceholder id= "Placeholderglobalnavigationsitemap" runat= "Server" >
Global navigation for subsites and sibling sites on the page.
Whether
<asp:contentplaceholder id= "PlaceHolderTopNavBar" runat= "Server" >
Container for placing the top navigation bar.
Whether
<asp:contentplaceholder id= "Placeholderhorizontalnav" runat= "Server" >
Navigation menu in the top navigation bar.
Whether
<asp:contentplaceholder id= "Placeholderleftnavbardatasource" runat= "Server"/>
Place the container that fills the data source needed for the left navigation.
Whether
<asp:contentplaceholder id= "Placeholdercalendarnavigator" runat= "Server"/>
A date selector for pages that contain calendars.
Whether
<asp:contentplaceholder id= "Placeholderleftnavbartop" runat= "Server"/>
The top area of the left navigation bar.
Whether
<asp:contentplaceholder id= "Placeholderleftnavbar" runat= "Server" >
Quick Launch bar.
Whether
<asp:contentplaceholder id= "placeholderleftactions" runat= "Server" >
Other objects on the Quick Launch bar.
Whether
<asp:contentplaceholder id= "PlaceHolderMain" runat= "Server" >
The main content of the page.
Whether
<asp:contentplaceholder id= "placeholderformdigest" runat= "Server" >
Stores the container for the Form Digest control in the page.
Whether
<asp:contentplaceholder id= "placeholderutilitycontent" runat= "Server"/>
The content attached at the bottom of the page is. From the HTML point of view, it is a part of the form tag.
Whether
<asp:contentplaceholder id= "Placeholdertitleareaclass" runat= "Server"/>
The class of the title section (now in the head tag). When customizing it, adding a webpartzone to this palceholder will cause an error.
Whether
<asp:contentplaceholder id= "Placeholderpageimage" runat= "Server"/>
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholdertitleleftborder" runat= "Server" >
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholderminiconsole" runat= "Server"/>
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholdertitlerightmargin" runat= "Server"/>
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholdertitleareaseparator" runat= "Server"/>
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholdernavspacer" runat= "Server" >
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholderleftnavbarborder" runat= "Server" >
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholderbodyleftborder" runat= "Server" >
is not part of the user interface and is for backwards compatibility.
Whether
<asp:contentplaceholder id= "Placeholderbodyrightmargin" runat= "Server" >
is not part of the user interface and is for backwards compatibility.
Whether
ASP. NET uses placeholder