Performance issue when dynamically populating a dropdownlist from a hidden frame

Discussion in 'ASP .Net' started by Wim, Apr 27, 2005.

  1. Wim

    Wim Guest

    Hi Everyone,

    I'm trying to speed up a Asp.net 1.1 applications' performance. The
    application needs to run in an environment with little bandwith and
    therefore pagesizes and roundtrip times shoud be brought back to a
    minimum.

    The application suffered from relatively large screens. A typical aspx
    page was 500 Kbyte so page load times were in the order of 40 - 50
    seconds. After unsufficient loading improvement using .net caching
    techniques like outputcaching and partial caching (location=Client), I
    went on the track of local (client-side) caching using hidden frames. I
    furthermore changed the navigation (dropdown menu) to load the
    userpages in another frame and added javascript to load the data from
    the hidden frames into the controls. So far, a pretty standard
    approach.

    Some details of the pages and the loading techniques:
    The data in the hidden frames is stored in javascript arrays (generated
    on the server) and only needs to be posted once. The page loaded in the
    hidden frame containing the data is about 200 KBytes. But the userpages
    decreased about 70% or more in size!!!
    To load the data into the dropdownlists I issue a client-side
    parents.myframe.location="pagetoload.aspx" when the user selects "page
    to load" from the menu. In "pagetoload.aspx" I stated an
    onload="LoadControls()" in the form tag to populate the controls
    automatically.

    I hope somebody is still with me :)

    After several different approaches however, I cannot get the javascript
    which loads the data to perform under 15 seconds, and of course I would
    like to bring it back to 1 or 2 seconds.
    The pages contain about 16 dropdownlists and some textboxes. Each
    dropdownlist gets loaded with approximately 500 options, so we are
    facing a load of about 8,000 options.

    This brings me to my question: is the dynamic loading of dropdownlist
    options in javascript given the number of options reasonable or can it
    be done in much less time?
    The way I add the options is pretty standard:

    var Option = new Option
    for (var i=0;i < parent.hiddenframe.arraywithtext.length; i++)
    {
    Option.Text = parent.hiddenframe.arraywithtext
    Option.Value = parent.hiddenframe.arraywithvalue

    parent.userframe.forms("LoadedPage").items("dropdownlist").Add(Option)
    }

    Is there a way to speed things up? I tried to disable the dropdownlist
    while loading but that does not deliver too much improvement, if any at
    all...

    Thanks a lot for reading, hope somebody has an idea!
    Wim
    Wim, Apr 27, 2005
    #1
    1. Advertising

  2. Wim

    Wim Guest

    Sorry wrong code, the new Option is of course placed inside the
    for-loop....
    Wim, Apr 27, 2005
    #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. Dhananjay
    Replies:
    1
    Views:
    655
    Mike Placentra II
    Dec 23, 2007
  2. Rick
    Replies:
    3
    Views:
    8,139
    Alexey Smirnov
    Apr 13, 2010
  3. Dhananjay
    Replies:
    0
    Views:
    104
    Dhananjay
    Dec 18, 2007
  4. Robert Kattke

    Populating Select <option>s with form/frame/js

    Robert Kattke, Mar 4, 2004, in forum: Javascript
    Replies:
    1
    Views:
    148
    Robert Kattke
    Mar 7, 2004
  5. SolarCanine
    Replies:
    2
    Views:
    271
    SolarCanine
    Sep 20, 2005
Loading...

Share This Page