Reputation: 73
Hello every one i want to use select 2 drop down which can easily filter
more than 10000 record butt in the given link
http://jsfiddle.net/a8La61rL/10/
using script a large function that is not good to use in every page
is there is any to use this script in a separate file and send list of array
objects to this method for populating and searching
Upvotes: 0
Views: 1795
Reputation: 1545
This is possible with the following steps.
1- Make an ASPX webservice or Web page function which will fetch a list of these records from a file using C#/Vb file handling and return in JSON array.
2- Use jQuery $.ajax method to fetch this json array from ASPX function or Webservice.
3- Bind the select2 in jQuery success event.
This will become a call, and on every page you can include this script and bind data. For better performance, you can also fetch first time from file and save in session or cookie and whenever any other page will call, it will fetch from session or cookie. I can explain further if required.
Upvotes: 1