Friday, July 6, 2012

Access Master Page Controls from Content page in Asp.Net

Access Master Page Controls from Content page in Asp.Net

Label masterpagelbl = (Label)Master.FindControl("lblMaster1");
TextBox masterpagetxt = (TextBox) Master.FindControl("txtMaster1");
 DropDownList masterpageddl = (DropDownList) Master.FindControl("ddlMaster1");
lblContent.Text = masterpagelbl.Text;
txtContent.Text = masterpagetxt .Text;
masterpageddl.SelectedIndex = 0;

No comments:

Post a Comment