Note that there are some explanatory texts on larger screens.

plurals
  1. PODo not filter results in jquery/asp.net autocomplete
    primarykey
    data
    text
    <p>I have the jquery autocomplete done with ajax call. I am doing filter in my code behind method. I do not want to filter them in the UI. How to do that. To be more specific if the user types 'St.' for e.g. I am returning values which has 'St.' as well as 'Saint' in the results. But jquery is not displaying the results with 'Saint'. how can I get jquery autocomplete to display 'Saint' as well?</p> <p>Code in Jquery</p> <pre><code> function GetNames(text) { $.ajax({ type: "POST", url: "Default.aspx/GetSchools", dataType: "json", data: '{ "data":"' + text + '"}', contentType: "application/json; charset=utf-8", success: function(data) { $('#university').autocomplete({ source: data.d, focus: function(event, ui) { $('#university').val(ui.item.Descr); return false; }, select: function(event, ui) { $('#university').val(ui.item.Descr); $('#universityID').val(ui.item.UnivCode); return false; } }); } }); } </code></pre> <p>Code Behind in .cs file</p> <pre><code>public static List&lt;DataClass.School&gt; GetSchools(string data) { DataTable dt = (DataTable)HttpContext.Current.Session["Schools"]; data = data.ToLower(); Debug.WriteLine(data); var ret = new List&lt;TestApplication.DataClass.School&gt;(); ret = (from l in dt.AsEnumerable() let s = l["Descr"].ToString().ToLower() where (s.Contains(data) || s.Contains("saint")) select new TestApplication.DataClass.School { Descr = l["Descr"].ToString(), UnivCode = l["UnivCode"].ToString() }).Take(20).ToList(); Debug.WriteLine(ret.Count.ToString()); return ret.ToList(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload