Hi,
Your main area of concern is to how you access control of content page into master page.
Here i put a button in master page and a control on content page on button click i have got the control on its value but it is little bit hard coding.
public partial class MasterPage : System.Web.UI.MasterPage
{
private Control myC;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (this.Page.Title == "first")
{
GetControls(this, "TextBox1");
TextBox myTextBox1 = (TextBox)Convert.ChangeType(myC, typeof(TextBox));
Response.Write(myTextBox1.Text);
}
}
public void GetControls(Control c, string FindControl)
{
foreach (Control cc in c.Controls)
{
if (cc.ID == FindControl)
{
myC = cc;
break;
}
if (cc.Controls.Count > 0)
GetControls(cc, FindControl);
}
}
}
Refer link is :
[
^]