<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager><asp:TextBox ID="txtMovie" runat="server"></asp:TextBox>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager><asp:TextBox ID="txtMovie" runat="server"></asp:TextBox><asp:AutoCompleteExtender ID="AutoCompleteExtender1" TargetControlID="txtMovie" runat="server" />
<System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()> Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String() Return Nothing End Function
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()] public static string[] GetCompletionList(string prefixText, int count, string contextKey) { return default(string[]); }
<System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()> Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String() ' Create array of movies Dim movies() As String = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"} ' Return matching movies Return ( From m In movies Where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase) Select m).Take(count).ToArray() End Function
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()] public static string[] GetCompletionList(string prefixText, int count, string contextKey) { // Create array of movies string[] movies = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"}; // Return matching movies return (from m in movies where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray(); }