Thursday, October 7, 2010

ASP PlaceHolder Control

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.


<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>


Label lblMessage = new Label();
lblMessage.Text = "Hello World I am Cool";

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.

Emmaneale Mendu
Web Developer.

No comments:

Post a Comment