G
Guest
Hi,
I have a master page, with a single content placeholder.
I create a content page for it with some appropriate content. At this point
everything is working fine.
However I need to change the type of my content page to use my own BasePage
class that contains a lot of code for handling resources and web service
calls. The PageBase class inherits from System.Web.UI.Page.
This a cutdown version with all my extra code removed.
public class PageBase: System.Web.UI.Page
{
protected override void OnInit(EventArgs e)
{
if (this.Master != null)
{
//prevents ASP.Net from shoving ctl001 in front of all my
tag ID's.
this.Master.ID = "demo";
}
base.OnInit(e);
}
}
So my content page code-behind looks like this:
public partial class contentPage: PageBase
{
....
}
Everything compiles fine.
When I load the content page and debug, all my code runs. In the browser the
title is set appropriately and other data-driven changes to the master page
are visible. However the content in the contentplaceholder does not render.
What happens when I inherit from System.Web.UI.Page that causes the content
page to no longer render?
Any thoughts?
GTB
I have a master page, with a single content placeholder.
I create a content page for it with some appropriate content. At this point
everything is working fine.
However I need to change the type of my content page to use my own BasePage
class that contains a lot of code for handling resources and web service
calls. The PageBase class inherits from System.Web.UI.Page.
This a cutdown version with all my extra code removed.
public class PageBase: System.Web.UI.Page
{
protected override void OnInit(EventArgs e)
{
if (this.Master != null)
{
//prevents ASP.Net from shoving ctl001 in front of all my
tag ID's.
this.Master.ID = "demo";
}
base.OnInit(e);
}
}
So my content page code-behind looks like this:
public partial class contentPage: PageBase
{
....
}
Everything compiles fine.
When I load the content page and debug, all my code runs. In the browser the
title is set appropriately and other data-driven changes to the master page
are visible. However the content in the contentplaceholder does not render.
What happens when I inherit from System.Web.UI.Page that causes the content
page to no longer render?
Any thoughts?
GTB