API
Version 7.x > API > Getting property values of dynamically created web parts View modes: 
User avatar
Certified Developer 8
Certified Developer 8
nrinat-ecentricarts - 1/8/2013 1:17:09 PM
   
Getting property values of dynamically created web parts
Hello

I need to dynamically load web parts in code behind and display them on-screen.
I use LoadControl to create the web parts. In the web parts I need to read the property value:
this.GetValue("Title")

The GetValue will always return null, probably because of the fact the the control life cycle is not being triggered by the LoadControl method.
Is there another way to access the web part property value?

Thanks!

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/9/2013 5:53:15 AM
   
RE:Getting property values of dynamically created web parts
Hi,

Have you tried looking into the "User control" web part which is available out of the box? This is our web part which purpose is to load the custom controls dynamically and ensure the life cycle. So, yu can take inspiration how to load the controls dynamically and how to work with them.

Best regards,
Juraj Ondrus