---
title: "PlaceHolder Control in Asp.Net"  
description: "The PlaceHolder Web server control does not have any visible output and is used as a place holder when we add controls at run time. The PlaceHolder"  
author: "Pushpendra Singh"  
published: 2010-10-28  
updated: 2020-03-26  
canonical: https://www.mindstick.com/articles/181/placeholder-control-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# PlaceHolder Control in Asp.Net

The PlaceHolder [Web server](https://www.mindstick.com/articles/23199/digital-personal-server-the-premium-web-server) control does not have any visible output and is used as a [**place holder**](https://www.mindstick.com/Articles/282/ajax-toolkit-tabcontainer-control-in-asp-dot-net) when we add [controls](https://www.mindstick.com/articles/66/how-to-create-controls-at-run-time-in-csharp-dot-net) at run time. The [PlaceHolder control](https://www.mindstick.com/interview/2086/what-is-the-use-of-placeholder-control-can-we-see-it-at-runtime) is used to reserve space for controls added by code.\

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

![PlaceHolder Control in Asp.Net](https://www.mindstick.com/mindstickarticle/76394502-7d59-4989-aa41-0edd03901561/images/c8360be0-208a-430f-a1b6-55b856fce4fb.png)

PlaceHolder is a [container](https://www.mindstick.com/forum/34127/extjs-how-to-set-border-for-the-container) of other web server control

![PlaceHolder Control in Asp.Net](https://www.mindstick.com/mindstickarticle/76394502-7d59-4989-aa41-0edd03901561/images/f66fd833-12fd-4ebb-b2f4-3b8fac63fcfd.png)

```
<asp:PlaceHolder ID="PlaceHolder1" runat="server">Search this website: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  <asp:Button ID="Button1" runat="server" Text="Start Searching" /></asp:PlaceHolder>
```

The advantage of using PlaceHolder is that the textbox, button and other content contained within the [**PlaceHolder opening**](https://www.mindstick.com/Articles/1486/creating-and-using-dll-dynamic-link-library-in-c-sharp) and closing HTML tags are [kept as](https://yourviews.mindstick.com/story/4850/10-snake-species-that-are-kept-as-pets) a single entity. For example, to hide the entire search form (i.e. text label, textbox, and button) only a single line of [C# code](https://www.mindstick.com/forum/403/how-to-export-data-in-excel-file-from-sql-server-using-c-sharp-code) is [required](https://yourviews.mindstick.com/view/81031/vigilence-required-during-corona-pandemic):

```
protected void Page_Load(object sender, EventArgs e)    {         PlaceHolder1.Visible = false;    }
```

Now when running the project then all control will not show on the page because here PlaceHolder [Visibility](https://www.mindstick.com/blog/301300/how-to-improve-your-visibility-in-zero-click-search-results) is false, and all control are inside PlaceHolder.

![PlaceHolder Control in Asp.Net](https://www.mindstick.com/mindstickarticle/76394502-7d59-4989-aa41-0edd03901561/images/dde519a9-3e58-4cb3-9506-46b2cb3ccaa1.png)

---

Original Source: https://www.mindstick.com/articles/181/placeholder-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
