How to work with Master Page that is attached to the page via the page's basepage?
问题 In my ASP.Net web application, I have a base page that implements functionality that spans all pages of the web application and my web pages derive from this base page. Since there is a single master page for the entire website, I don't want to attach the master page in each of the web pages. So I attached the Master page via the basepage's OnPreInit method as follows: protected override void OnPreInit(EventArgs e) { this.MasterPageFile = "~/Site.master"; base.OnPreInit(e); } However, when I