Powered by Blogger.

Thursday, September 26, 2013

What is ContentPlaceHolder in Masterpage in asp.net?



In this post we will discuss about contentplaceholders in master page in asp.net. Also you can check out my previous posts on:

- ExecuteNonQuery(), ExecuteReader() and ExecuteScalar() in Ado.Net

- Singleton class in C#.Net

- Cookieless session in Asp.Net

In  ASP.NET Web site development master page is frequently used. A master page defines common structure, layout, navigation and default content for all of the webpages of web application including headers,footers, style definitions, or navigation bars. The master page can be shared by any of the pages in the Web site, called the Content page.A content page is a web page that is connected to master page and that displays its own individual content along with the content of the master page. The ContentPlaceHolder is used by the content page to display its own content.

Below is the ContentPlaceHolder tag:

<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>



0 comments

Post a Comment