Generate dynamic controls from Database tables

A

Adi

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
Adi
 
N

Natty Gur

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,890
Messages
2,569,972
Members
46,308
Latest member
DonaldDarr

Latest Threads

Top