W Weston Fryatt Oct 1, 2006 #1 Can you change text or add controls dynamically on a Master Page (not in the Content Place Holder)?
M Mark Rae Oct 1, 2006 #2 Can you change text or add controls dynamically on a Master Page (not in the Content Place Holder)? Click to expand... Yes - a MasterPage is really just a particular kind of UserControl. So, e.g. if the MasterPage had a Label called "lblHeading", you could do the following in the Page_Load method of the ContentPage: ((Label)this.Master.FindControl("lblHeading")).Text = "Hello world";
Can you change text or add controls dynamically on a Master Page (not in the Content Place Holder)? Click to expand... Yes - a MasterPage is really just a particular kind of UserControl. So, e.g. if the MasterPage had a Label called "lblHeading", you could do the following in the Page_Load method of the ContentPage: ((Label)this.Master.FindControl("lblHeading")).Text = "Hello world";
J Jesse Liberty Oct 1, 2006 #3 Yes, but if you anticipate it in advance, you can make the label's text a property of the master page public string LblHeading { get { return this.lblHeading.Text; } set { this.lblHeading.Text = value; } } Then, in the content page, all you have to write is this.Master.LblHeading = "Hello World";
Yes, but if you anticipate it in advance, you can make the label's text a property of the master page public string LblHeading { get { return this.lblHeading.Text; } set { this.lblHeading.Text = value; } } Then, in the content page, all you have to write is this.Master.LblHeading = "Hello World";
M Mark Rae Oct 1, 2006 #4 Yes, but if you anticipate it in advance, you can make the label's text a property of the master page public string LblHeading { get { return this.lblHeading.Text; } set { this.lblHeading.Text = value; } } Then, in the content page, all you have to write is this.Master.LblHeading = "Hello World"; Click to expand... Of course. A class is a class is a class...
Yes, but if you anticipate it in advance, you can make the label's text a property of the master page public string LblHeading { get { return this.lblHeading.Text; } set { this.lblHeading.Text = value; } } Then, in the content page, all you have to write is this.Master.LblHeading = "Hello World"; Click to expand... Of course. A class is a class is a class...