Article
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    APIs
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog

Home >> ASP.Net & Web Forms >> PlaceHolder Control in Asp.Net
PlaceHolder Control in Asp.Net
PlaceHolder Control in Asp.Net


by Pushpendra Singh on 10/28/2010 4:11:14 PM

Views: 2218       Comments: 0

PlaceHolder Control in ASP.Net

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 control is used to reserve space for controls added by code.

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

PlaceHolder Control in ASP.Net

PlaceHolder is a container of other web server control

PlaceHolder Control in ASP.Net

 

<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 and closing HTML tags are kept as 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 is required:

protected void Page_Load(object sender, EventArgs e)

    {

        PlaceHolder1.Visible = false;

    }

Now when run the project then all control will not show on the page because here PlaceHolder Visibility is false; and all control are inside PlaceHolder.

 

PlaceHolder Control in ASP.Net

Report Abuse Form
Reason:    
 

Title :
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
     
 
Latest Article by Pushpendra SinghRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 2694
Advertisement
MindStick Cleaner
Advertise with Us
  
Copyright © 2013MindStick. All Rights Reserved.