Hi Guys
I have a handler (.ashx) file that I'm using to deal with Requests. Depending on the type of output needed, I want to load a user control that will present the data in the correct format.
I thought that when I created the instance of MyUC its load event would fire, but i guess not. I've even tried specifying my own event handler but that doesn't work.
For what it's worth noting, I can create the instance of the MyUC and assign the funds to its Funds property. It's the load event that I need to actually do stuff with that list of funds!
This is the code that i have, which doesn't work.
private string GenerateList(IEnumerable<Fund> funds)
{
string html = "";
Page page = new Page();
MyUC myControl = (MyUC)page.LoadControl("MyUC.ascx");
myControl.Funds = funds;
myControl.Load += new EventHandler(myControl_Load);
return html;
}
Can anyone tell me what I'm doing wrong? How can I go about fixing it?
Thanks
Dave