473,396 Members | 2,034 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,396 software developers and data experts.

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

Nov 24 '06 #1
2 1434
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/archi...11/430382.aspx

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

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"shapper" <md*****@gmail.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.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
Nov 24 '06 #2
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/archi...11/430382.aspx

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

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"shapper" <md*****@gmail.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.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
Nov 24 '06 #3

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

Similar topics

20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
1
by: Fred Nelson | last post by:
I have a question regarding page caching in a C# Web App that I'm developing. I have used page caching successfully in VS2003 at the page level - and it also works the same in VS2005. I have...
13
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas?...
5
by: Kevin | last post by:
We currently have a 1.1 class library which houses the look and feel of our website by creating the html form dynamically in a base class. We then distribute our assembly to other application...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
2
by: n# | last post by:
I have an old existing website with a Header/ Left Hand Menu and a iframe as the main body content, adjacent to the menu. So for every click on the menu item, I used to load a aspx page on the...
4
by: lichaoir | last post by:
I have two questions about the use of Master Page: 1. How to access properties and controls in the master page from content page? (I know I can use the "FindControl()" method of the "Master"...
0
by: KingKong07 | last post by:
Hi! I have a problem with publishing my solution. I use “Use fixed naming and single page assemblies” to publish. So I just can update one and one file, this works fine, but today I had to update...
5
by: Murray | last post by:
Forgive me if this question is too basic, but I'm new to ASP.NET programming, and I can't locate a simple answer to this question. I have a web page that consists of a Master Page and a single...
6
by: Mickey | last post by:
Coming from a Dreamweaver/ASP/PHP background. Planning to use Visual Studio 2008 for a website. Complete newbie question here (please be gentle!): Do master pages work similar to Dreamweaver...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.