Is there any way to automatically bind a custom class to a given set of web controls? For instance, supposing I have an instance BindableObject of the class
public class BindableClass
{
public string FirstString { get; set; }
public string SecondString { get; set; }
public bool BooleanValue { get; set; }
}
I would like to be able to (somehow) do
BindableObject.BindToForm(SomeGroupOfControls);
provided I had previously defined what SomeGroupOfControls is, instead of having to do
txtSomeTextBox.Text = BindableObject.FirstString;
lblSomeTextBox.Text = BindableObject.SecondString;
chkSomeCheckBox.Checked = BindableObject.BooleanValue;
Is this possible somehow?