마스터 페이지 TestMaster.MASTER

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.Web.UI.HtmlControls;

public partial class MasterPage_MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public void Test() {

        Response.Write("날 부른거냐?");
    }

}

TestMaster.MASTER로 생성된 default.aspx 컨텐츠 페이지

public partial class MasterPage_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

MasterPage_MasterPage mc = (MasterPage_MasterPage )this.Page.Master;
        mc.Test();
    }
}

+ Recent posts