2.0 master pages and codebehind cycle

D

Daves

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 ??
 
D

Daves

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

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


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

blows my mind
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,610
Members
45,254
Latest member
Top Crypto TwitterChannel

Latest Threads

Top