How to dynamically create controls on the client

L

Luke Breuer

I am in charge of writing a criteria selection page for queries. There
is the potential for a hundred or even hundreds of fields. Since we
want to display a decent amount of controls/data for each field, this
would quickly eat up space if all the controls were generated at the
server and sent to the client. Currently we have a setup like this
that requires a 500 KB download - absolutely unacceptable.

I would like to know if it's "kosher" or even possible to send the
user a list of the fields, their datatypes, etc., along with a piece of
javascript that will create the controls on the client side. If it is
at all possible, I would like to encapsulate this functionality so the
code-behind can access something simple like an Items collection to see
all the controls that were added.

The reason I want all the controls loaded at once is that roundtrips to
the server would take an noticeable amount of time that would be nice
if it could avoided.

Thanks in advance,
Luke Breuer
 
K

kw

If you are going to go that route, you could also consider using a Windows
app. The 500k still has to be downloaded, but you should make sure it's
downloaded only once by specifying a js file that loads the control data.
Another solution would be to break the problem up; using a TabStrip that
either dynamically loads all the content (via ASP.NET) or just loads
references to a separate js file.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top