Tuesday, 13 March 2012

How to access label / textbox control value of master page on any other aspx.cs using c# asp.net

How to access label / textbox control value of master page on any other aspx.cs using c# asp.net :


ContentPlaceHolder contentPlaceHolder =
(ContentPlaceHolder) Master.FindControl("cphBody");

ControlType myControl =
(ControlType) contentPlaceHolder.FindControl("ControlID");


*ControlID - indicates the id of label/textbox or any other control