-1

I have about 40,000 contacts in the database and using ASP.NET (VB.NET).

I have to search through these contacts with one text box that filters contacts instantly. Also need to accommodate multiple words in the textbox.

Trying to load all the contacts on the client side with JSON, and using javascript table filter does not work efficiently. It waits for the whole table to be loaded and fails to go beyond 10000 or so records.

Please let me know if there is any way to achieve this efficiently

1 Answers1

2

Well, of course a pure javascript solution is going to have to load all of the contacts in order to filter them... Javascript is purely on the client side of things.

What you need to do is research page methods and have your javascript call a page method, passing in exactly what had been typed up to that point. Then your page method should issue a select call to the database to pull the top N records that begin with what was typed. A good value for N is probably 10.

Also, you probably should have your javascript not make the call until at least a few characters have been typed in; something like 3 or 4 is usually good.

NotMe
  • 87,343
  • 27
  • 171
  • 245