Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Nested Master Pages

Reply
Thread Tools

Nested Master Pages

 
 
shapper
Guest
Posts: n/a
 
      11-29-2006
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

 
Reply With Quote
 
 
 
 
shapper
Guest
Posts: n/a
 
      11-29-2006
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using update panel with master & nested master pages katmagic ASP .Net 0 12-26-2008 07:41 PM
VB Master-Details Edit (Separate Pages), Response Redirect to Master Page Databinding Issue... Sam ASP .Net 0 07-20-2006 02:31 AM
Cross Page Post Back When Using Mixture of Master Pages and Non-Master Pages Jason@webbit.com ASP .Net 1 05-16-2006 02:00 PM
Master Pages Great! But what about Master User Controls? Electrified Research ASP .Net 5 10-11-2005 02:32 PM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57