Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Nested Master Pages

Nested Master Pages

Scheduled Pinned Locked Moved ASP.NET
designhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shapper
    wrote on last edited by
    #1

    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 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups