Last post Oct 22, 2014 03:36 AM by Kevin Shen - MSFT
Oct 21, 2014 04:32 AM|crazy_legs|LINK
In my code I have an AJAX AutoComplete, looks like this:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" TargetControlID="TextBox1" CompletionSetCount="10" MinimumPrefixLength="2">
Its fairly straight forward and I have done this kind of thing connecting the Web Service from SQL, however this time within the Web Service I wont to connect to a array from strings. The strings will be the network ID's. The web service looks like:
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
Public Class WebService2
Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
Dim ctx As New PrincipalContext(ContextType.Domain)
Dim group As GroupPrincipal = GroupPrincipal.FindByIdentity(ctx, "####")
' Create a list of strings.
Dim list As New List(Of String)
' if found....
If group IsNot Nothing Then
' iterate over members
For Each p As Principal In group.GetMembers()
I could chuck the lot into a database beforehand but wouldn't mind trying to solve the problem in the first instance. Anyone got any suggestions?...
Oct 21, 2014 04:33 AM|crazy_legs|LINK
Should also mention I dont get any errors, it just doesnt seem to show the dropdown of results..
Oct 22, 2014 03:36 AM|Kevin Shen - MSFT|LINK
First I suggest that you can set a breakpoint on the webservice method,check if it can be hit
Second,Here is a working demo which you can download for you about how to use ajax autocomplete :
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
completely understand the risk before retrieving any software from the Internet.