How to dynamically create controls on the client

Discussion in 'ASP .Net Web Controls' started by Luke Breuer, Jul 12, 2004.

  1. Luke  Breuer

    Luke Breuer Guest

    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
    Luke Breuer, Jul 12, 2004
    #1
    1. Advertising

  2. Luke  Breuer

    kw Guest

    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.

    "Luke Breuer" <> wrote in message
    news:ccucdn$...
    > 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
    >
    kw, Jul 12, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David J. Berman

    How do I dynamically create user controls?

    David J. Berman, Jun 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,393
    David J. Berman
    Jun 30, 2003
  2. Steven Caliendo

    Dynamically create controls ?

    Steven Caliendo, Dec 22, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    460
    Kevin Spencer
    Dec 22, 2003
  3. tommy
    Replies:
    0
    Views:
    368
    tommy
    Jun 14, 2004
  4. Jeffrey Todd
    Replies:
    1
    Views:
    4,085
    Peter Blum
    Jun 2, 2005
  5. crjunk
    Replies:
    2
    Views:
    124
    crjunk
    Dec 9, 2005
Loading...

Share This Page