all groups > asp.net building controls > may 2004 >
You're in the

asp.net building controls

group:

Generate dynamic controls from Database tables


Generate dynamic controls from Database tables aditya028 NO[at]SPAM yahoo.com
5/28/2004 8:26:08 AM
asp.net building controls:
Hi,
I'm trying to generate controls like textboxes, drop downs
dynamically. I need to get their type and the values from the DB. Any
suggestions on how to generate them?
Thanks
Re: Generate dynamic controls from Database tables Natty Gur
6/1/2004 8:38:04 PM
Adi Hi,
Hi,

I think that the easiest way to do it is to build factory class that
receive control type and assembly name (for controls that doesn't ship
with VS) as string parameter and return instance of that control.

you can save control type and assembly name (for controls that don't
ship with VS) in DB. Get that data from your DB on page load, send that
data to your factory and use Controls collection to add the new control
into your page.

HTH


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377


*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button