D
Daves
I am using 2.0 masterpages. All content pages use some common variables, for
example the DB connection string. Also some pages return links which are
located in a "sublink" area in the masterpage. So the masterpage code would
1) create the public string DBConn and 2) check the public string SubLinks
if it contains any links after the content page was run (if not, hide the
sublink bar). Using Page_OnLoad event the masterpage code is run after the
content page which is fine for 2). For 1) I need it to run BEFORE and I
tried using
void Page_OnPreInit (System.EventArgs e) ...
and even
protected override void OnPreInit(System.EventArgs e) ...
The first line is never run in the first place (not even Page_OnPreInit).
The second line creates error "no suitable method found to override".
So how do I create a masterpage event other than OnLoad???
example the DB connection string. Also some pages return links which are
located in a "sublink" area in the masterpage. So the masterpage code would
1) create the public string DBConn and 2) check the public string SubLinks
if it contains any links after the content page was run (if not, hide the
sublink bar). Using Page_OnLoad event the masterpage code is run after the
content page which is fine for 2). For 1) I need it to run BEFORE and I
tried using
void Page_OnPreInit (System.EventArgs e) ...
and even
protected override void OnPreInit(System.EventArgs e) ...
The first line is never run in the first place (not even Page_OnPreInit).
The second line creates error "no suitable method found to override".
So how do I create a masterpage event other than OnLoad???