Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Set property of control on form by name

var controlName = 'yourcontrolName from db';
var propertyName = 'your property name from db';
object value = //the deserialized value from db;

var control = findControlByName(controlName);
control.GetType().GetProperty(propertyName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance).SetValue(control, value, new object[] { });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Set #property #control #form
ADD COMMENT
Topic
Name
1+9 =