Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a list for drop down menu

Status
Not open for further replies.

SurvivorTiger

Programmer
Jul 9, 2002
265
US
Hi everyone,

I have several aspx pages and they all need to have a drop-down list. These drop-down lists need to be identical, but instead of writing html code for every page to create the long list of items, I want to use C# to dynamically create the drop-down list. For instance I could have the content of the list in a text file on the server, then my C# code would read the lines from the text file and create the drop-down list. I would greatly appreciate it if someone could help me with this.

Thank you
 
If the items won't change much, then just store the data in cache, and load the dropdown on any page you need.
 
you have a couple options.
1. use a master page and place the drop down within the master
2. create a web user control (ascx) with the drop down and place the user control on each page (or master)

if you use the web user control you can cache just that control (partial page caching) caching the control/page at this point may be overkill if you're not expriencing latency.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top