Calling a function of a dynamically loaded usercontrol
Posted on 2008-10-31
I am loading a user control:
userControlName = "~/Modules/Login/Controls/RegisterControl.ascx"
Dim userControl As Control = Page.LoadControl(userControlName)
userControl.ID = "pvRegister" & e.PageView.ID
Now I want to call a function of that user control to set some values within it. How do I call a dynamically created control?
I know I could do it with this if it weren't dynamic, but I don't know how to get it dynmically.
I have 5 user controls on the page, all the same control, but different display based on what value I passed into them, so I need to send that value.