User Control And Master Page ASP.Net

<%@ Page Language="C#" MasterPageFile="~/Default.master" 
                       AutoEventWireup="true" 
                       CodeFile="Default.aspx.cs" 
                       Inherits="ProgrammedHome" 
                       Title = "Programmed Master Page Home" %>
<%@ MasterType VirtualPath="~/Default.master" %>

  

title


  

AAA




  

title


  

BBB



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.Web.UI.HtmlControls;
public partial class ProgrammedHome : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
      Master.AdImageUrl = "~/Images/ads/ad3.gif";
      Master.AdNavigateUrl = "http://www.rntsoft.com";
   }
}
File: Default.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Default.master.cs" Inherits="ProgrammedContentMaster" %>





   
      
         
            
            
            
            

         

         
            
               
                  Home
                  Products 
                  About
               
            

            
               
                 

default side content


                 
                      
         
         
            
              

default main content


            
         
         
            

this is a test.


                  
      
   


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.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class ProgrammedContentMaster : System.Web.UI.MasterPage
{
   public string AdImageUrl
   {
      get { return imgbtnAd.ImageUrl; }
      set { imgbtnAd.ImageUrl = value; }
   }
   public string AdNavigateUrl
   {
      get { return imgbtnAd.NavigateUrl; }
      set { imgbtnAd.NavigateUrl = value; }
   }
}