I have a webform where I use 50 different user controls. I have solved the problem with help from DANIEL (thanks again) by adding the user controls to a placeholder. But I have a problem:
How do I call functions in the the user controls? I receive an error saying:
Everything is working well when I just place the user control on the form, but that is not smart to do when I have 50 controls. So I have checked that there is nothing wrong with the code below as long as the user control is not placed in the placeholder.Code:Object reference not set to an instance of an object
What is wrong?
Code:Dim ctlCond1Abs As Control = LoadControl("Cond1Abs.ascx") Dim ctlCond1Black As Control = LoadControl("Cond1Black.ascx") Sub SetLanguage() Page.Controls.Add(ctlCond1Abs) plh1.Controls.Add(ctlCond1Abs) cond1Abs1.LangArray1 = clsLanguage1.getLanguage(session("language")) cond1abs1.setLanguage() End Sub




Reply With Quote