ASP.NET - how to set a value of textbox which lies on master page.

Asked By shoaib mansoori on 28-Jul-12 05:13 AM
Hi all
i am creating an application and which i have a master and on master page i have put a textbox and from the child pages of i want to set a value on a textbox.
how can i do this?
i need this because of my requirement.
thanks
Peter Bromberg replied to shoaib mansoori on 28-Jul-12 08:02 AM
Page class has a Master property which returns a reference to the Master Page. So you can write,

TextBox foundTextBox =Page.Master.FindControl("TextBox1");