Master Page Question  
Author Message
KHill





PostPosted: Fri Nov 24 08:03:32 CST 2006 Top

ASP.Net >> Master Page Question Hello,

I have 2 pages: Page1.aspx and Page2.aspx.
The two pages have common design parts but also not common design
parts.

Is it possible to create something like this:

MasterPageA
|
|---- MasterPageB
|
|---- Page1.aspx

MasterPageA
|
|---- MasterPageC
|
|---- Page2.aspx

See?
Page1 uses Master Pages A and B.
Page2 uses Master Pages A and C.

Could you tell me if I should do this and if it is possible.
If yes, where can I find some information about it?

Thanks,
Miguel

Web Programming336  
 
 
Karl





PostPosted: Fri Nov 24 08:03:32 CST 2006 Top

ASP.Net >> Master Page Question Sounds like you are asking if Master Pages can be nested, and the answer is
yes.

You can learn a bit more at:
http://weblogs.asp.net/scottgu/archive/2005/11/11/430382.aspx

and it's pretty easy to test out anyways...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"shapper" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Hello,
>
> I have 2 pages: Page1.aspx and Page2.aspx.
> The two pages have common design parts but also not common design
> parts.
>
> Is it possible to create something like this:
>
> MasterPageA
> |
> |---- MasterPageB
> |
> |---- Page1.aspx
>
> MasterPageA
> |
> |---- MasterPageC
> |
> |---- Page2.aspx
>
> See?
> Page1 uses Master Pages A and B.
> Page2 uses Master Pages A and C.
>
> Could you tell me if I should do this and if it is possible.
> If yes, where can I find some information about it?
>
> Thanks,
> Miguel
>

 
 
shapper





PostPosted: Fri Nov 24 14:19:41 CST 2006 Top

ASP.Net >> Master Page Question Sometime ago I followed an article (I believe MSDN) related with
localization in Asp.Net 2.0.

To make pages localization I create a class named Localization:

1 Public Class _Localization
2 Inherits Page
3
4 Sub Localization_PreInit(ByVal sender As Object, ByVal e As
EventArgs) Handles MyBase.PreInit
5 Page.MasterPageFile = "~/_Base.master"
6 Page.Theme = "_Base"
7 End Sub
8
9 ' _Base master page culture
10 Protected Overrides Sub InitializeCulture()
11 MyBase.InitializeCulture()
12 Dim language As String = CType(Context.Profile,
ProfileCommon).Language
13 If (language IsNot Nothing) AndAlso (language <> "Auto") Then
14 MyBase.UICulture = language
15 Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(language)
16 End If
17 End Sub
18
19 End Class

My Base master page is as follows:

1 Partial Class _Base
2 Inherits System.Web.UI.MasterPage
3 ...
4 End Class

And my page is given by:

1 Partial Class _Default
2 Inherits Localization
3 ...
4 End Class

Well, now I need page Default to use two master pages. Base and Content
where:

Base

| ----- Content


Now I am really lost here. [:)]

Could someone help me out in implementing this?

By the way, I am developing everything at runtime.

Thanks,

Miguel

Karl Seguin wrote:
> Sounds like you are asking if Master Pages can be nested, and the answer is
> yes.
>
> You can learn a bit more at:
> http://weblogs.asp.net/scottgu/archive/2005/11/11/430382.aspx
>
> and it's pretty easy to test out anyways...
>
> Karl
>
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
>
> "shapper" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > Hello,
> >
> > I have 2 pages: Page1.aspx and Page2.aspx.
> > The two pages have common design parts but also not common design
> > parts.
> >
> > Is it possible to create something like this:
> >
> > MasterPageA
> > |
> > |---- MasterPageB
> > |
> > |---- Page1.aspx
> >
> > MasterPageA
> > |
> > |---- MasterPageC
> > |
> > |---- Page2.aspx
> >
> > See?
> > Page1 uses Master Pages A and B.
> > Page2 uses Master Pages A and C.
> >
> > Could you tell me if I should do this and if it is possible.
> > If yes, where can I find some information about it?
> >
> > Thanks,
> > Miguel
> >