How to Execute Page_Load() in Page's Base Class?

后端 未结 6 849
不知归路
不知归路 2020-12-24 05:56

I have the following PerformanceFactsheet.aspx.cs page class

public partial class PerformanceFactsheet : FactsheetBase
{
    protected void Page_Load(object         


        
6条回答
  •  粉色の甜心
    2020-12-24 06:35

    try this one

     public partial class PerformanceFactsheet : FactsheetBase
    {
        public PerformanceFactsheet()
        {
            this.Load += new EventHandler(this.Page_Load);
        }
    
        protected void Page_Load(object sender, EventArgs e)
        {            
            divPerformance.Controls.Add(this.Data);
        }
    }
    
    public abstract class FactsheetBase : System.Web.UI.Page
    {
        public MyPageData Data { get; set; }
        public FactsheetBase()
        {
            this.Load += new EventHandler(this.Page_Load);
        }
    
        new protected void Page_Load(object sender, EventArgs e)
        {            
            this.Data = ExtractPageData(Request.QueryString["data"]);
        }
    }
    

提交回复
热议问题