1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
<script type="text/javascript"> $(document).ready(function() { $("#<%=txtSearch.ClientID%>").autocomplete('Search_CS.ashx'); }) </script> <asp:RadioButton ID="FirstName" runat="server" Text="First Name" GroupName="Search" /> <asp:RadioButton ID="LastName" runat="server" Text="Last Name" GroupName="Search" /> <br /> <br /> <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox> then i have a .ashx file that talk to the database.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
<script type="text/javascript"> $(document).ready(function(){ var chk = $('input[name^="Search"]:checked').attr('id'); liveSearch(chk) $('#FirstName').click(function(){ liveSearch('Search_CS.ashx') }); $('#LastName').click(function(){ liveSearch('2.ashx') }); }); function liveSearch(page){ $("#<%=txtSearch.ClientID%>").autocomplete(page); } </script>