Hi folks,
I'm working on a web application in VS2012, asp.net 4.5. I've got a master page with various controls and I've encapulated all my aspx pages in a base class because the functionality on each page is identical. Now, I can't seem to update the controls on
the master page from the base class in a strongly typed way.
I have properties on the master page like:
public string setTitle
{
set { lblTitle.Text = value; }
}
Where lblTitle is a label on the master page. From the code-behind pages I could just set the VirtualPath to Master and set the title thus: Master.setTitle = "whatever".
This doesn't work from the base page. For some reason lblTitle is null, I assume because of post-backs.
I know I can do the following:
((Label)Page.Master.FindControl("lblTitle")).Text = "whatever"
And if the field ...
Go to the complete details ...