i want to change values of controls in a User Control when i clikc on a button in a another user control, but i get following error:
Object reference not set to an instance of an object
Code:
//in My DownUserControl i call
protected void BTN_Click(object sender, EventArgs e)
{
TopUserControl TopUC = new TopUserControl();
TopUC.Title = "hello";
}
//and here I get the error in the TopUserControl:
public string Title
{
get { return TitleLable.Text }
set { TitleLable.Text = value }
}
Object reference not set to an instance of an object
Code:
//in My DownUserControl i call
protected void BTN_Click(object sender, EventArgs e)
{
TopUserControl TopUC = new TopUserControl();
TopUC.Title = "hello";
}
//and here I get the error in the TopUserControl:
public string Title
{
get { return TitleLable.Text }
set { TitleLable.Text = value }
}