Call function in user control placed in placeholder?
I have attached a project which contain a webform including a placeholder. The placeholder is loaded with a user control. How do I activate a function in the user control from the webform?
Re: Call function in user control placed in placeholder?
My palceholder is named plh1. When I apply this code
plh1.FindControl("Cond1Abs.ascx")
I'm not able to apply the function SetLanguage, that I want to call for the Cond1Abs.ascx? What am I doing wrong?
Re: Call function in user control placed in placeholder?
You have to look for it by it's ID, not the file name. Make sure you are using the ID. I see in your post above you have the . ascx as part of your call to FindControl. The .ascx should not be there.
Re: Call function in user control placed in placeholder?
I don't know I didn't actually run your code or change it up any. I basicly just looked at it and looked at how you cast in VB.Net.
I don't know that much about VB.Net anymore. I started C# about 2 years ago and I refuse to go back to VB.Net and have subsequently erased all information regarding it....
If you have MSDN I recomend looking at Placeholder and it's implemetation of FindControl in your MSDN. Also I've never used a PlaceHolder I always use a Panel.