Hi,
What type of control is it? Suppose it's a Label:
Label banner = (Label)
Parent.Page.Master.FindControl("Adserver_TopBanner 1");
If you don't know the type, there is no need for a cast, but you will
only be able to access the properties and methods that the Control
class defines.
On the other hand, what Christian suggested is also a good option. In
your master page, you could define a property as:
public string MyProperty {
get {
return Adserver_TopBanner1.Text;
}
set {
this.Adserver_TopBanner1.Text = value;
}
}
And then, you can access it as suggested in the above post.
============
Regards,
Steve
www.stkomp.com
Poofactory wrote:
HI,
I have a control on a content page that I need to access and modify a
MasterPage variable.
I can find the control alright:
if (Parent.Page.Master.FindControl("Adserver_TopBanne r1") !=
null)
{
}
But I cannot figure out how to cast it so I can change the MasterPage
vars.
Any help would be greatly appreciated.
Thanks!