Results 1 to 4 of 4

Thread: Items in a dropdownlist

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Items in a dropdownlist

    Hi!

    I am developing an asp.net application using c#.

    I have to display some items in a dropdownlist. Same dropdownlist is displayed in several pages in my application. Presently, the items are hardcoded. For some reason, I dont want to pick it up from the database and populate it.

    But since, the dropdown list is on several pages, I want a store, where I just change the collection (items) and my items in the dropdown list is refreshed in all the pages.

    Can it be done. Can something be done with web.config?
    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Items in a dropdownlist

    I'm not sure if this is viable in ASP.NET but I think you should be able to put your list items in an array or collection and bind your list controls to it. Then a change in the underlying array or collection should be reflected in each control.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Items in a dropdownlist

    Quote Originally Posted by sinha
    Hi!

    I am developing an asp.net application using c#.

    I have to display some items in a dropdownlist. Same dropdownlist is displayed in several pages in my application. Presently, the items are hardcoded. For some reason, I dont want to pick it up from the database and populate it.

    But since, the dropdown list is on several pages, I want a store, where I just change the collection (items) and my items in the dropdown list is refreshed in all the pages.

    Can it be done. Can something be done with web.config?
    Why don't you want to pick it up from your database?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: Items in a dropdownlist

    Because there is no database in this application. Basically I am building a tool.

    For this purpose only, I do not want to use a data base.
    Anyway, I am doing that through a user control, which I am including in my page.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width