Speed up development with full-stack environments for every branch.

Learn More

How to use Master Pages in ASP.NET

4893 Runs 22032 Views 3910 Copies
Saved

Saved

mirang 126

mirang
published 4 years ago

<%@ Page Language="C#" MasterPageFile="Site1.Master"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!--This being a child you can inject  your own head information,
So hear we have injected one style divMainTime of the child control
-->
<style type="text/css">
.divMainTime
    {
      width:450px;
      height:30px;
      background-color:#fdd136;
      font-size:14px;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<!-- asp:content is where each individual child page will inject its content. 
One thing to note is the ContentPlaceHolderID should match the asp:ContentPlaceHolder ID value in the master page
 -->
 <div class='divMainTime'>
    This is a child page content
 </div>
</asp:Content>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).