c# - Bind Dropdownlist with viewbag get slow -


i'm trying bind list dropdownlist using 'htmlhelper' , slow. have approximately 200k records in dropdown list using select2.js searchable dropdown. how can make faster?

  @html.dropdownlistfor(model => model.stundetnumber, (list<selectlistitem>)viewbag.studentnumber, new { @class = "form-control stundetnumber select2", @multiple = "" }) 

you creating dropdown 200k items in view. may applying select2.js after that, server still has render , serve 200k items. it's going slow, , browser have trouble rendering intial dropdown.

you should investigate loading data on demand, such select2.js provides ajax support: https://select2.github.io/examples.html#data-ajax


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -