Coder Social home page Coder Social logo

master-page-demo's Introduction

Master-Page-Demo

A VB.Net WebForms project showing one approach to using master pages with wet-boew.

This is using the Government of Canada (GC) Intranet theme for the Web Experience Toolkit.

The start page of the project should be set to home-accueil-eng.aspx. The urlMappings section of the web.config file will translate this to Home.aspx. One should then be able to cycle between English and French by using the language toggle on the top-right.

Any new page should inherit from BasePage instead of System.Web.UI.Page.

Another option is to use multiple language-specific master pages instead of a single master page with resource files. In this case, a BaseMaster.vb file should be created in the Classes folder to hold common functionality and each master page would then inherit from BaseMaster instead of MasterPage. The following function would be placed in BasePage.vb:

    ''' <summary>
    ''' Load a specific master page based on the language of the current culture.
    ''' </summary>
    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreInit

        Select Case Threading.Thread.CurrentThread.CurrentCulture.ThreeLetterISOLanguageName
            Case "fra"
                Me.MasterPageFile = "MasterPage-fra.Master"
            Case Else
                Me.MasterPageFile = "MasterPage-eng.Master"
        End Select
    End Sub

master-page-demo's People

Contributors

robjohnston avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.