I work with C# and when to list very users in dropdown I should wait for a long time. Are 11.100 users to list.
I try use the DropDownListFor with select2 for the can be possible search:
@Html.DropDownListFor(m => m.IDUser, ListUsers(), new { @class = "form-control input-sm select2" })
@Html.ValidationMessageFor(m => m.IDUser)
The function ListUsers() given by:
IQueryable<Usuario> query;
query = from user in User
join address in Address on user.Id equals address.IDUser
where address.State == address
select user;
return query.ToList();
This image show how the wait happened:
In the region 1 I click in the dropdown and selected the first user.
In the region 2 I scroll over the dropdown to the last user and selected him.
In the region 3 I click again in the dropdown and was the interval to show the dropdown.
Additional information:
The interval of time to execute the function ListUser() that is related with region 3 is:
Then, we can see that time of search is lower than time of wait.
I would like to understand the why this is happened. - Why the dropdown is with too large delay? - How can I should be resolve this?
OBS: Sorry for my English.