I found this article that I'm following -
http://www.odetocode.com/code/94.aspx
I added this to the User Control:
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.upDateDates += new EventHandler(dates_upDateDates);
}
Then this:
protected void dates_upDateDates(object sender, System.EventArgs e)
{
OnupDateDates(e);
}
public event EventHandler upDateDates;
protected void OnUpDateDates(EventArgs e)
{
if(upDateDates != null)
{
upDateDates(this, e);
}
}
the DDL is looking for dates_upDateDates.
Then on the Parent Page:
protected asmain.controls.dates Dates1; - declared up top
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
Dates1.upDateDates += new EventHandler(Dates1_upDateDates);
}
private void Dates1_upDateDates(object sender, EventArgs e)
{
Response.Write("i made it to the parent page");
}
I'm getting "Object reference not set to an instance of an object." on Dates1.upDateDates += new EventHandler(Dates1_upDateDates);