Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
i want to

get masterpage textbox value in childpage

i have a master page and have a textbox in it.

and i want that
masterpage's textbox value in child page
Posted

Try this
C#
TextBox txtbox = this.Master.FindControl("YOUR TEXTBOX ID") as TextBox;
 
Share this answer
 
v2
Hai

Try like this

C#
TextBox1.Text = ((TextBox)Master.FindControl("TextBox1")).Text;

Regards
Aravind
 
Share this answer
 
v3
Hi Try this
C#
MasterPage page = new MasterPage();
 TextBox value= (TextBox)page.FindControl("textboxid in masterpage");
string value=value.Text;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900