Hello,
I am creating a web site with Nested Master pages.
I also need to have a class where the culture is set. When the culture
is changed by the user the page refreshes and the change takes effect.
I saw this approach, I think, on a MSDN web site or blog:
Config.vb Class where culture is set from profile value
_Base.master Parent master page
( _Navigation Child master page)
Default.aspx.vb Page
I have this working without the child master page _Navigation. I can't
make this work with the child master page.
Could someone help me out with this?
This is the code for my 3 working pages (Config.vb, _Base.master and
Defaul.aspx.vb)
----- Config.vb -----
1 Public Class Config
2 Inherits Page
3
4 Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs)
Handles MyBase.PreInit
5 Response.Write("Config")
6 Page.Theme = CType(Context.Profile,
ProfileCommon).Config.Theme
7 End Sub
8
9 Protected Overrides Sub InitializeCulture()
10 MyBase.InitializeCulture()
11 Dim language As String = CType(Context.Profile,
ProfileCommon).Config.Language
12 If (language IsNot Nothing) AndAlso (language <"Auto") Then
13 MyBase.UICulture = language
14 Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(language)
15 End If
16 End Sub
17
18 End Class
----- Base.master.vb -----
1 Partial Class _Base
2 Inherits System.Web.UI.MasterPage
3
4 Protected Sub Page_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Init
5 Response.Write("Base.master")
6 End Sub
7
8 End Class
9
10
----- Default.aspx.vb -----
1 Partial Class _Default
2 Inherits Config
3
4 Protected Overloads Sub Page_PreInit(ByVal sender As Object,
ByVal e As EventArgs) Handles Me.PreInit
5 Me.MasterPageFile = "~/_Base.master"
6 End Sub
7
8 Protected Sub Page_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Init
9 Response.Write("Default.aspx")
10 End Sub
11
12 End Class
Could someone help me out in integrating a Child Master page between
_Base.master and Default.aspx?
Thanks,
Miguel 1 2032
Please,
Could someone help me out with this?
Thanks,
Miguel
shapper wrote:
Hello,
I am creating a web site with Nested Master pages.
I also need to have a class where the culture is set. When the culture
is changed by the user the page refreshes and the change takes effect.
I saw this approach, I think, on a MSDN web site or blog:
Config.vb Class where culture is set from profile value
_Base.master Parent master page
( _Navigation Child master page)
Default.aspx.vb Page
I have this working without the child master page _Navigation. I can't
make this work with the child master page.
Could someone help me out with this?
This is the code for my 3 working pages (Config.vb, _Base.master and
Defaul.aspx.vb)
----- Config.vb -----
1 Public Class Config
2 Inherits Page
3
4 Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs)
Handles MyBase.PreInit
5 Response.Write("Config")
6 Page.Theme = CType(Context.Profile,
ProfileCommon).Config.Theme
7 End Sub
8
9 Protected Overrides Sub InitializeCulture()
10 MyBase.InitializeCulture()
11 Dim language As String = CType(Context.Profile,
ProfileCommon).Config.Language
12 If (language IsNot Nothing) AndAlso (language <"Auto") Then
13 MyBase.UICulture = language
14 Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(language)
15 End If
16 End Sub
17
18 End Class
----- Base.master.vb -----
1 Partial Class _Base
2 Inherits System.Web.UI.MasterPage
3
4 Protected Sub Page_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Init
5 Response.Write("Base.master")
6 End Sub
7
8 End Class
9
10
----- Default.aspx.vb -----
1 Partial Class _Default
2 Inherits Config
3
4 Protected Overloads Sub Page_PreInit(ByVal sender As Object,
ByVal e As EventArgs) Handles Me.PreInit
5 Me.MasterPageFile = "~/_Base.master"
6 End Sub
7
8 Protected Sub Page_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Init
9 Response.Write("Default.aspx")
10 End Sub
11
12 End Class
Could someone help me out in integrating a Child Master page between
_Base.master and Default.aspx?
Thanks,
Miguel
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Joseph Ferris |
last post by:
Hello,
I am having an issue with page breaking that I hope someone will be
able to help me with. Still a relative "newbie", and I thought this
might be a good place to find some help. I have a...
|
by: Steve Franks |
last post by:
I have this cool nested master page scenario working great. However what is
the correct way to be able to access a strongly typed property at the top
level master from a content page that has a...
|
by: iturner100 |
last post by:
Hi,
I've been struggling with this one for a couple of hours without much
joy.
Basically, I've got a set of nested masterpages (3 as it happens). I'm
dynamically generating a new page in code...
|
by: Diane Yocom |
last post by:
I have two nested master pages, each with public properties. From my
content page, I am able to access properties from both pages using either
Master.PropertyName (for the child master page) or...
|
by: Rolf Welskes |
last post by:
Hello,
for a large web site project we would like to use nested Master Pages.
Unfortunely VS2005 is not able to show pages in design mode when
nested Master pages are used.
This has the...
|
by: John |
last post by:
Hi,
I'm having trouble with nested master pages (and creating the same behaviour
as Scott Guthrie's blog post...
|
by: shapper |
last post by:
Hello,
I am using ASP.NET 3.5 and VS 2008 to create 2 level Nested Master
pages.
I am adding the controls and the content place holders at runtime.
However now my child pages do not recognize...
|
by: daveh551 |
last post by:
I've seen reference to Nested Master Pages in some of the
documentation, but I haven't been successful in creating one in VS
2005 (Framework 2.0). I just did a search on it, and "How To:...
|
by: daveh551 |
last post by:
Okay, another problem I'm having with nested master pages on VS 2005.
I've got a MasterPage,master, as SubMaster.master, and a
DesignTime.master, and a content page, default.aspx.
The...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |