We will assume that we have a Label control called "Label1" on your Master Page, you might want to change the text of that Label.
To do that write this code in your content page:
To do that write this code in your content page:
Label lbl = new Label();
lbl = (Label)Master.FindControl("Label1");
lbl.Text = "Text";
Of course, this is all assuming the label is OUTSIDE the ContentPlaceHolderSource: https://www.nilebits.com/blog/2003/05/how-to-access-controls-on-master-pages-from-content-pages-in-asp-net/
Very helpful
ReplyDeleteThanks
M.Gamal (and this is smart code )
ReplyDelete[c#]
ontxtName textChanged event
btnOK.Enabled=(txtName.Text !="")
[eng_mohamed_gamal2@yhoo.com]