User Control And Master Page ASP.Net

<%@ Page Language="C#" MasterPageFile="Default.master" 
    AutoEventWireup="true" CodeFile="Default.aspx.cs" 
    Inherits="Default" 
    Title="Hello, Master" 
    %>

    

Welcome to this page!


    

master!



File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Drawing;
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ((ASP.MasterWithProp)Master).TitleBoxText = "ASP.NET";
        ((ASP.MasterWithProp)Master).TitleBoxForeColor = Color.Cyan;
    }
}
File: Default.master
<%@ Master  Language="C#" AutoEventWireup="true" CodeFile="Default.master.cs" 
    Inherits="MasterPages_SimpleWithProp" Classname="MasterWithProp" %>



    Hello, master pages


    
        
            
                                           runat="server" 
                           EnableTheming="False" 
                           Font-Bold="True" 
                           Font-Names="Impact"
                           Text="Anything" 
                           Width="100%">
            
            
            
                                   runat="server" 
                       BorderStyle="Outset"
                       BorderWidth="1px" 
                       Width="100%" 
                       HorizontalAlign="Right">
                                           runat="server" 
                           EnableTheming="False" 
                           Font-Bold="True" 
                           Font-Names="Lucida Console"
                           Text="sub title" 
                           Font-Size="Large" 
                           ForeColor="Orange">
                    
        
    



File: Default.master.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
public partial class MasterPages_SimpleWithProp : System.Web.UI.MasterPage
{
  public string TitleBoxText
  {
    get { return TitleBox.Text; }
    set { TitleBox.Text = value; }
  }
    public Color TitleBoxForeColor
    {
        get { return TitleBox.ForeColor; }
        set { TitleBox.ForeColor = value; }
    }
}