473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Content Not Rendering in Master Page

GTB
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
Jul 25 '06 #1
1 1939
Hi,

I have the same exact problem.
I figured out that it is cause because they way we're accesing the master
page.
I think that is not the correct way, though, I don't know what's the right
way either.
I'm gonna investigate more on this and post my findings.

Regards,

"GTB" <GT*@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
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

Sep 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Federico | last post by:
I have a problem, I have an event declared in a Master Page, and I want to use in a Content Page holder of a Content Page. When I want to create the method to handle the event, I can njot reference...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
7
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
3
by: Managed Code | last post by:
I have a BasePage class that derives from System.Web.UI.Page. All of my content pages derive from this. The derived page classes use the following MasterType declaration that follows to reference...
8
by: Amit | last post by:
I have a master page and a content page but the stylesheet isnt getting applied like how it looks in visual studio design view. The master page is defined like this: <%@ Master Language="VB"...
3
by: MikeB | last post by:
Hello, I have a content page that is from a Master page which has 2 content panes. How do I add my forms to the content page? Each pane needs a form but you can not have multiple form tags nor...
5
by: =?Utf-8?B?UmJydA==?= | last post by:
There is a lot of good material related to using Master Pages for formatting controls and putting common design elements on multiple pages. I have VB.NET code that is common to all of my pages...
2
by: John | last post by:
Hi, I'm having trouble with nested master pages (and creating the same behaviour as Scott Guthrie's blog post...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.