in UserControl2.ascx.cs
private string setExContent;
public string SetExContent
{
get
{
return setExContent;
}
set
{
setExContent = value;
}
}
public void populateScreen()
{
string totContent = SetExContent;
//Populate all the fields of Usercontrol2 from totContent.
}
In User Contol1 I have
In userControl1.cs button click I want to set the property of SetExContent user control2 and call the metod populate screen.
void button2_click
{
usercontrol1.SetExContent = testhid.value; //Set user control2 property
populateScreen(); //Call user control2 method
}
How do I call user control2 property and method on user control1 button click.Pls provide the code.
----------------------------------------
For your Info--
The two user controls are getting loaded in a page pagemail.aspx which has a code like this
------------------------
private string userControl1Path = "UserControls/userControl1.ascx";
private string userControl2Path = "UserControls/usercontrol2.ascx";
UserControls.UserControl1 userControl1;
UserControls.UserControl2 userControl1;
userControl1 = this.Page.LoadControl(this.userControl1P
this.controlHolder.Controls.Add(UserCont
userControl2 = this.Page.LoadControl(this.userControl2P
this.controlHolder.Controls.Add(UserCont
------------------------------
Replies
Know the answer? Post it — somebody with the same question will find it here.