2.0 master pages and codebehind cycle

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

    2.0 master pages and codebehind cycle

    I am using the codebehind in my masterpage to set some global variables
    which all children (content) pages use, for example the DB connection
    string.
    It seems the master page code is run AFTER the content pages' and so the
    content page code never sees these variables. Can I change this? Or should I
    pherhaps use some other alternative eg. an user control (with codebehind) or
    even global.aspx ??


  • Daves

    #2
    Re: 2.0 master pages and codebehind cycle

    found this (to be placed in masterpage code behind):

    protected override void OnPreInit(Event Args e)
    {
    ... my code ...
    base.OnPreInit( e);
    }


    well... I get error "no suitable method found to override"

    blows my mind


    Comment

    Working...