c# - AJAX Auto Complete Extender not working in ASP.NET -
i using ajax auto complete extender auto complete functionality in text box in asp.net, not working.
here textbox , autocomplete extender:
<div class="col-md-6 nopadding paddingr-5"> <span>airline</span> <asp:textbox id="txtairline" runat="server"></asp:textbox> <cc1:autocompleteextender servicemethod="searchairline" minimumprefixlength="2" completioninterval="100" enablecaching="false" completionsetcount="10" targetcontrolid="txtairline" id="autocompleteextender1" runat="server" firstrowselected="false"> </cc1:autocompleteextender> </div>
and here service method in code behind file:
[system.web.script.services.scriptmethod()] [system.web.services.webmethod] public static list<string> searchairline(string prefixtext, int count) { list<string> objlist = new list<string>(); foreach (airlineinfo in users.airlines) { if(i.airlinecode.contains(prefixtext) || i.airlinename.contains(prefixtext)) { objlist.add(i.airlinecode + " - " + i.airlinename); } } return objlist; }
the script manager set enable page methods. code behind service method never gets executed. can me sort out?
Comments
Post a Comment