Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Content Not Rendering in Master Page

Reply
Thread Tools

Content Not Rendering in Master Page

 
 
=?Utf-8?B?R1RC?=
Guest
Posts: n/a
 
      07-25-2006
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
 
Reply With Quote
 
 
 
 
Craig
Guest
Posts: n/a
 
      09-27-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Content Placeholder in nested master content page John ASP .Net 2 01-15-2008 11:48 AM
Master-Content in Asp.net - How to set individual Head for each content page Rolf Welskes ASP .Net 7 08-22-2006 02:47 PM
Setting the Page Title using local resources for a content page in a master page Laith Zraikat ASP .Net 3 07-06-2006 01:23 AM
limit on number of content placeholders(which are editable in content pages) in master page nemesis.saurabh@gmail.com ASP .Net 0 05-25-2006 04:44 AM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments