ASP. NET HUGE pages resulting from common DropDownList controls problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • writeallnight
    New Member
    • Feb 2008
    • 7

    ASP. NET HUGE pages resulting from common DropDownList controls problem

    I am working in ASP .NET 2.0 and have a Web application which requires many (48) DropDownList s which all need to show the same data list; and the list is like 400 items long. I have been working in the industry for many years and have no problem in building the data list from a DB, attaching it to all 48 controls, and having the app/page work OK, but (as you experts are no doubt saying) the page re-draw is painful and the size of the delivered page is huge. I have no doubt that there is some "correct" way to do this which does not require the HTML to carry every one of the 48 X 400 lists explicitly spelled out, (or of course some slicker way to do this in the ".aspx" page) but I can't find it. Thanks for any help.
    Last edited by jhardman; Feb 22 '08, 12:32 AM. Reason: moved to .Net forum. ASP forum is for "classic" ASP
  • markrawlingson
    Recognized Expert Contributor
    • Aug 2007
    • 346

    #2
    Ouch. So the end result is 48 drop down lists each with 400 items displayed simultaneously on a single page?

    Why do you need ALL 48 displayed on the same page? Is it a master/sub category situation, or what's the deal? Explain a bit further what the purpose of these 48 controls are exactly and how they function. Without knowing that I can't really offer up a competent solution but it sounds like you may want to sort of 'split' the data load somehow, using page enumeration or perhaps ajax if those options are possible and pertinent to the end result.

    One of the web sites I work with has sort of the same situation, but not nearly as drastic. The site has 500 end categories (and growing), plus the master categories and sub categories, etc. We use 3 drop down list controls so that a user can choose the master or top category, then a sub category, and then the end category. When a user chooses a master or top category, we use ajax to make a silent request in the backend to grab the sub categories according to what the user chose in the master/top category drop down, and fill in the control with whatever data we get back.

    In this way, the page loads with only the master/top category drop down filled in (maybe 50 <option>s at most), the sub category and end category drop downs only fill in when the user chooses a master/top category (and sub-category, respectively) - so the page doesn't load all 500-600 categories on the page all at once - they only load when needed.

    Explain the situation a little bit further and perhaps even provide a link if at all possible, and we'll see what we come up with ;)

    Sincerely,
    Mark

    Comment

    • writeallnight
      New Member
      • Feb 2008
      • 7

      #3
      Mark,

      Thanks for the response; and yes there are some ways I can "sidestep" the problem; the most obvious is that since the user doesn't always (for all instances/"uses" of the Page) use/need all 48 of the DDLs, I can wait to populate them until we know (from page postbacks) exactly how many of the 48 they will need; then populate just what they will need (however to some extent this will be the same problem; because there are many cases where 30+ of the 48 are actually used; so the difference between 30+ and 48 is small...)

      Phil

      Comment

      • markrawlingson
        Recognized Expert Contributor
        • Aug 2007
        • 346

        #4
        so the difference between 30+ and 48 is small...)
        True, but it would be a start.

        The obvious problem here is the page load, and the page load is caused by the amount of data that's being spat out at once. As such, your only real solution is to somehow split that data load into sections - a crafty UI solution to this problem is in order.

        Do you have a copy of the page online somewhere so I can take a look, I'm pretty good with UI solutions and may be able to offer up some solutions on how you can split the data load into sections rather than spitting it onto the page in one go.

        Sincerely,
        Mark

        Comment

        • writeallnight
          New Member
          • Feb 2008
          • 7

          #5
          Mark,

          I just took an hour or so and re-wrote the binding code so that it only loads those DDLs which are actually used, and I am getting literally an order of magnitude faster redraws. The customer is so happy they can't see. Sometines it helps just to talk to someone...

          Thanks very much,

          Phil

          Comment

          • markrawlingson
            Recognized Expert Contributor
            • Aug 2007
            • 346

            #6
            Sometines it helps just to talk to someone...
            Couldn't agree with you more Phil. Sometimes I talk to my wife or my father about problems I'm having in programming. They know very little about computers in general, let alone programming - however just talking to someone and getting the juices flowing ALWAYS helps me get to an end solution. Sometimes completely off-topic suggestions like "bunny rabbits eat lettuce" even help, as odd as that sounds.

            Anyway, glad that you were able to fix the problem!

            Sincerely,
            Mark

            Comment

            Working...