MyUserControl control = (MyUserControl)Page.LoadControl("somepath.ascx");
control.MyFunction();
http://openmymind.net/index.aspx?documentId=9
Karl

Signature
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
> Hi,
>
[quoted text clipped - 5 lines]
>
> Jim.
Jim - 20 Jul 2005 15:34 GMT
Hi, I can't seem to get any of the solutions provided in your tutorial
to work? I have a user control containing a public method.
I would like to call this method from the web form that dynamically puts
the control into a placeholder.
The two lines of code you seem to be saying do the job are:
5: Results r = (Results)Page.LoadControl("Results.ascx");
6: r.Info = SomeBusinessLayer.GetAllResults(); //valid
???
Any extra help on how I can achieve this would be much appreiciated....
Jim
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com