B
Bob
In ASP.NET 1.1, I have a base page for all my pages in an application. The
base page contains some common properties that every page needs, the code
behind file of every page looks like this:
public class Home : MyBasePage {
.....
}
and in it I can simply refer them as base.MyProperty (or just
this.MyProperty). This seems no longer possible in the ASP.NET 20 master
page, as the code behind file for the master page is only a partial class.
There's no way to inherit from a partial class in the code behind file:
public partial class Home : MyMasterPage { //This does not work
}
If I simply add a new page assigning it the master page, any HTML code is
inherited but the members defined in the master page code behind file are
not recognized. Any way to make this work?
Thanks
Bob
base page contains some common properties that every page needs, the code
behind file of every page looks like this:
public class Home : MyBasePage {
.....
}
and in it I can simply refer them as base.MyProperty (or just
this.MyProperty). This seems no longer possible in the ASP.NET 20 master
page, as the code behind file for the master page is only a partial class.
There's no way to inherit from a partial class in the code behind file:
public partial class Home : MyMasterPage { //This does not work
}
If I simply add a new page assigning it the master page, any HTML code is
inherited but the members defined in the master page code behind file are
not recognized. Any way to make this work?
Thanks
Bob