A Placeholder as its name implies – it is a placeholder for controls or objects.
To see how it works, insert a PlaceHolder control into your page and then add controls to it from your server-side code in the manner shown below.
.aspx
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
.cs
Label lblMessage = new Label();
lblMessage.Text = "Hello World I am Cool";
PlaceHolder1.Controls.Add(lblMessage);
Here we are creating a new instance of Label control and adding it to placeholder control. You can add more than one control to a single instance of a PlaceHolder control.
Thanks
Emmaneale Mendu
Web Developer.
ASP Standard Controls
- ASP Label Control
- ASP TextBox Control
- ASP Button Control
- ASP Link Button Control
- ASP ImageButton Control
- ASP HyperLink Control
- ASP DropDownList Control
- ASP ListBox Control
- ASP CheckBox Control
- ASP CheckBoxList Control
- ASP RadioButton Control
- ASP RadioButtonList Control
- ASP Image Control
- ASP ImageMap Control
- ASP Calendar Control
- ASP Table Control
- ASP BulletedList Control
- ASP Hidden Control
- ASP Literal Control
- ASP AdRotator Control
- ASP Panel Control
- ASP PlaceHolder Control
- ASP FileUpload Control
- ASP UserControl
- ASP Custom Control
Random Tips and Tricks
Thursday, October 7, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment