Adding dynamic controls

Within an existing .net system at work, there was a requirement to generate dynamic controls. Depending on certain business factors, the controls for data entry would either be textboxes or dropdownlists. In both cases the fields would be mandatory.

The solution involved database tables which contained the configuration for each setup, i.e txtboxes or dropdownlists and whether or not the field was mandatory. On entering the aspx page the code behind checks the configuration, creates the controls dynamically and adds them to a placeholder.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s