best method for populating drop down list control?

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

I'd like to hear your thoughts on best methods for populating drop down list
controls. I have states and countries drop down lists that don't change
often, so naturally I "hard code" them in the aspx page. But the problem is
these tend to really slow the development -- it takes up to 15 seconds for
the page to come up in VS.NET design environment, so I'm thinking about
taking these out and populating the controls dynamically using the
filesystem or an xml file. Easy enough to do, but will this then eat up
resources in runtime?

-Max
 
F

Fred Newton

Output caching your page (or the user control within which your drop down
list appears) would substantially mitigate any runtime performance issues
you may be concerned about if you were to populate the list at runtime. And
given that the content changes rather infrequently, you could (1) read the
content into a DataList (or your other favorite in-memory structure) and
save it in the application's Cache object. Then populate it from there at
runtime. You could even put a File Dependency on it so that when you modify
the XML file that contains your states list, the in-memory version in the
Cache automatically updates.

Separately, and not to split hairs, but you should tell us how you defnie
"best method" for populating the list. "Best" meaning "fastest runtime
performance"? "Best" meaning "most flexible in terms of the content that can
be specified at runtime"? "Best" meaning "least development time"?

Good Luck.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top