M
Mike P
Hi,
I have a problem which I'm sure lots of people must have seen so apologies
if this is well known!
Each of my aspx pages inherits from a base class which contains some
intitalization code for all pages. All ths user cotrols on the page use
these intialised fields however, placing them in the OnInit event of the
base page means they do not get run till last which means the user controls
do not see those initialized fields and so have empty object refrences. To
solve this I put the intialization code into the contructor for the base
page HOWEVER, this blows up the designer in Visual Studio as the
initialization code references objects that are only available at runtime
and when opening up the page in the designer, a horrible object not set to
reference occurs. Is there anyway to have my cake and eat it? Can I
initialize these fields in the base class, have them available in my user
controls but not have the designer blow up?
Any help wil be graetfully received
Cheers
Mike
I have a problem which I'm sure lots of people must have seen so apologies
if this is well known!
Each of my aspx pages inherits from a base class which contains some
intitalization code for all pages. All ths user cotrols on the page use
these intialised fields however, placing them in the OnInit event of the
base page means they do not get run till last which means the user controls
do not see those initialized fields and so have empty object refrences. To
solve this I put the intialization code into the contructor for the base
page HOWEVER, this blows up the designer in Visual Studio as the
initialization code references objects that are only available at runtime
and when opening up the page in the designer, a horrible object not set to
reference occurs. Is there anyway to have my cake and eat it? Can I
initialize these fields in the base class, have them available in my user
controls but not have the designer blow up?
Any help wil be graetfully received
Cheers
Mike