Master Pages. Is this impossible in Asp.Net 2.0? I don't know what else to try!

Discussion in 'ASP .Net' started by shapper, Nov 29, 2006.

  1. shapper

    shapper Guest

    Hello,

    I am, for almost 2 days, trying to create a nested master page.

    The objective is: create a NESTED master page at RUNTIME.

    I looked everywhere and I couldn't find a solution. Basically what I
    need is:

    Parent.master
    | ---Child.master
    |---Page.aspx

    I know that in Page.aspx I can define, at runtime, the page master file
    in the Page.Preinit event:
    Me.MasterPageFile = "~/Child.master"

    However, in Child.master I am not able to define a Page.PreInit event.
    So how to I say to Child.master to use Parent.master as master page.

    Remember that I am trying to do this at Runtime and not in aspx code.

    Could somebody help me out?

    I don't know what else to try.

    Thanks,
    Miguel
    shapper, Nov 29, 2006
    #1
    1. Advertising

  2. shapper

    clintonG Guest

    Go to http://OdeToCode.com and read some of the best articles about Master
    Pages.

    <%= Clinton Gallagher
    NET csgallagher AT metromilwaukee.com
    URL http://clintongallagher.metromilwaukee.com/
    MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h

    "shapper" <> wrote in message
    news:...
    > Hello,
    >
    > I am, for almost 2 days, trying to create a nested master page.
    >
    > The objective is: create a NESTED master page at RUNTIME.
    >
    > I looked everywhere and I couldn't find a solution. Basically what I
    > need is:
    >
    > Parent.master
    > | ---Child.master
    > |---Page.aspx
    >
    > I know that in Page.aspx I can define, at runtime, the page master file
    > in the Page.Preinit event:
    > Me.MasterPageFile = "~/Child.master"
    >
    > However, in Child.master I am not able to define a Page.PreInit event.
    > So how to I say to Child.master to use Parent.master as master page.
    >
    > Remember that I am trying to do this at Runtime and not in aspx code.
    >
    > Could somebody help me out?
    >
    > I don't know what else to try.
    >
    > Thanks,
    > Miguel
    >
    clintonG, Nov 29, 2006
    #2
    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. DP
    Replies:
    0
    Views:
    1,126
  2. shapper
    Replies:
    4
    Views:
    457
    Juan T. Llibre
    Nov 15, 2006
  3. shapper
    Replies:
    1
    Views:
    2,288
    shapper
    Feb 7, 2008
  4. Gilles Ganault
    Replies:
    7
    Views:
    321
    John Machin
    Nov 15, 2008
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    214
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page