F
fishek
I have a Master Page with a property defined in codebehind like this:
private string profile;
public string Profile {
get { return profile; }
}
I can set the property value in the master page fine (normally
page_load or page_preinit), i.e.:
profile = "custom";
In the page that uses the Master page, I can see the property like
this:
string test = Master.Profile;
But, The property is ALWAYS null. It never saves the value I give it
in the Master Page codebehind. Is there any way around this issue? I
would like to pre-initialize some common properties without having to
copy the code into each aspx page. Thanks for the help!
Kyle
private string profile;
public string Profile {
get { return profile; }
}
I can set the property value in the master page fine (normally
page_load or page_preinit), i.e.:
profile = "custom";
In the page that uses the Master page, I can see the property like
this:
string test = Master.Profile;
But, The property is ALWAYS null. It never saves the value I give it
in the Master Page codebehind. Is there any way around this issue? I
would like to pre-initialize some common properties without having to
copy the code into each aspx page. Thanks for the help!
Kyle