<asp:TextBox ID="txtClientUser" runat="server" ClientIDMode="Static" onChange="$find('AutoCompleteExtender5').set_contextKey(this.value);" onblur="checkClientSelected(this)"></asp:TextBox> <ajax:AutoCompleteExtender ID="AutoCompleteExtender4" runat="server" TargetControlID="txtClientUser" CompletionInterval="10" CompletionSetCount="100" MinimumPrefixLength="1" EnableCaching="false" ServiceMethod="GetClientName" ServicePath="~/CMSAdmin/frmClientMaster_New.aspx" OnClientItemSelected="ClientNameSelected" FirstRowSelected="false"></ajax:AutoCompleteExtender>
<asp:TextBox ID="txtAdd1User" runat="server" onkeyup="SetContextKey()" onblur="CheckAddressSelected(this)"></asp:TextBox> <ajax:AutoCompleteExtender ID="AutoCompleteExtender5" runat="server" TargetControlID="txtAdd1User" CompletionInterval="10" CompletionSetCount="100" EnableCaching="false" ServiceMethod="GetAddressName" ServicePath="~/CMSAdmin/frmClientMaster_New.aspx" OnClientItemSelected="AddressSelected" UseContextKey="true"></ajax:AutoCompleteExtender>
[System.Web.Script.Services.ScriptMethod()] [System.Web.Services.WebMethod] public static List<string> GetAddressName(string prefixText, string ClientId) { SqlConnection conn = ApplicationInfo.GetConnection(); List<string> AddressName = new List<string>(); try { DataTable dt = AddressManager.Search_AddressName(conn, prefixText, ClientId).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { string Item = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dt.Rows[i]["AddressName"].ToString(), dt.Rows[i]["AddressId"].ToString()); AddressName.Add(Item); } } catch (Exception ex) { } finally { conn.Close(); conn.Dispose(); } return AddressName; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)