Re: Master page variable - access on content page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matty J

    Re: Master page variable - access on content page

    Excellent, thanks Nathan.

    The problem I'm having is that I want the variable set in the *Master*
    page base class. Setting the variable in the Master Base Class
    Page_PreInit event doesn't seem to happen before the Content Page Base
    Class PreInit event, as casting the Master Page Base Class's public
    variable in the Content Page Base Class only returns null...?

    Also, 'Me.' does not seem to be working, do you mean 'this.'?

    Cheers
    Matt
  • Matty J

    #2
    Re: Master page variable - access on content page

    Hi Nathan, and thanks again for your reply.

    I managed to get it work, primarily by going back to basics and
    building up from there, using your advice etc., so that I didn't have
    so many variables affecting it.

    These two articles were particularly good help:

    Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


    I think in the end I was using events such as BasePage_PreIni t as per
    in the first example, thinking that it was an actual .NET event when
    it wasn't, so it actually needed to be added to the PreInit event.

    Do you know of any actual list of the exact event names of master/
    content page load?

    Cheers
    Matt

    Comment

    Working...