Results 1 to 2 of 2

Thread: @html.dropdownlist with 1000 elements

  1. #1

    Thread Starter
    Addicted Member Cristian's Avatar
    Join Date
    Jun 2006
    Posts
    228

    Smile @html.dropdownlist with 1000 elements

    I have a select in my view that have around 1000 elements
    I use the sentence:

    <body>
    ...
    <td>@html.dropdownlist("MyList")</td>
    </body>

    My question is:
    how can i to optimize this task because take too long in show the view in the browser ?

    Any ideas will be thanks

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

    Re: @html.dropdownlist with 1000 elements

    Showing a drop-down with that many options is a bad idea regardless. Whenever we have that many options, we use a suggestion box, i.e. a jQuery plug-in that works basically the same way as the auto-complete functionality in a WinForms TextBox. The user starts typing and you use AJAX to populate a drop-down with a small number of matching items.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

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