<%@ 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
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; }
}
}