MasterPage

Discussion in 'ASP .Net Web Controls' started by Amilkar Calles, May 19, 2008.

  1. Does anybody knows if exist any way to use a master page without
    the "ContentPlaceHolderID" in the content page? (the default.aspx or
    services.aspx for example)

    What I want to do is load this aspx with the masterpage specified in the
    webconfig

    Thanks!
    Amilkar Calles, May 19, 2008
    #1
    1. Advertising

  2. Amilkar Calles

    Stan Guest

    On 19 May, 06:51, "Amilkar Calles" <> wrote:
    > Does anybody knows if exist any way to use a master page without
    > the "ContentPlaceHolderID" in the content page? (the default.aspx or
    > services.aspx for example)
    >
    > What I want to do is load this aspx with the masterpage specified in the
    > webconfig
    >
    > Thanks!


    The MasterPage is specified in the @page directive of the content
    pages not in web.config.

    If you want to present the MasterPage as a viewable page on its own
    then just leave the content placeholders empty in a designated content
    page. Nothing is rendered in the content placeholder locations if they
    are blank even though they appear in design view.
    Stan, May 19, 2008
    #2
    1. Advertising

  3. You can specifiy the Master page in the Web.config file with no problem
    However, there is no way to get the page loaded without the
    ContentPlaceholder
    That's where the content of the individual pages is placed. Without the
    ContentPlaceholder in each page, there is no content on each page.


    David Wier
    http://aspnet101.com
    http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
    bloated markup


    "Amilkar Calles" <> wrote in message
    news:...
    > Does anybody knows if exist any way to use a master page without
    > the "ContentPlaceHolderID" in the content page? (the default.aspx or
    > services.aspx for example)
    >
    > What I want to do is load this aspx with the masterpage specified in the
    > webconfig
    >
    > Thanks!
    >
    Seth Williams, May 21, 2008
    #3
  4. Amilkar Calles

    Stan Guest

    Dear Seth, Amilkar

    On 21 May, 20:11, "Seth Williams" <> wrote:
    > You can specifiy the Master page in the Web.config file with no problem
    > However, there is no way to get the page loaded without the
    > ContentPlaceholder
    > That's where the content of the individual pages is placed. Without the
    > ContentPlaceholder in each page, there is no content on each page.


    Thank you Seth for pointing out my mistake about the option to specify
    the master page file in web.config (it can be included as an attribute
    in the <pages> tag). It may be a lack of experience (or imagination)
    on my part but I cannot see any advantage in doing it that way and VS
    2005 designer doesn't seem to support it.

    It isn't quite true however that Content pages must have content place
    holders in order for the page to be rendered. The rules are a bit more
    complex than that and with good reason.

    Master pages must have at least one content placeholder. That makes
    sense otherwise it might as well be an ordinary page.

    Content placeholders in Master pages can be non-empty. Anything placed
    in them acts as default content for dependent pages.

    Content placeholders in Content pages are optional. When they are
    absent they are replaced with default content from the Master page. If
    they are present then they overwrite any default content from the
    Master page (which means that all default content is removed even if
    the local placeholder is empty).

    What this adds up to is that, conceivably, a Content page can have no
    placeholders and will render the Master page with default content
    only. It makes no sense however to have more than one Content page
    like this.
    Stan, May 30, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    MasterPage -> Page -> MasterPage Code Access

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    7,883
    Steven Cheng[MSFT]
    Apr 14, 2006
  2. ThunderMusic
    Replies:
    2
    Views:
    444
    Gregory Gadow
    Sep 27, 2006
  3. Randy Smith
    Replies:
    9
    Views:
    420
    Mark Rae
    Apr 14, 2007
  4. mr t
    Replies:
    0
    Views:
    399
  5. Torben Laursen
    Replies:
    4
    Views:
    571
    clintonG
    Mar 15, 2008
Loading...

Share This Page