【发布时间】:2011-07-30 16:25:49
【问题描述】:
我在使用 jquery 和 javascript 从客户端设置上下文键时遇到问题。找不到ASP.Net的AutoCompleteExtender的set_contextKey函数。
这是我用于文本框和 AutoCompleteExtender 的 HTML...
<asp:TextBox ID="txtProduct" runat="server" AutoPostBack="true" OnTextChanged="txtProduct_TextChanged" Width="181px" /><ajaxToolkit:AutoCompleteExtender
ID="AutoCompleteExtender_txtProduct" BehaviorID="acExt" runat="server" TargetControlID="txtProduct"
CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" MinimumPrefixLength="2"
CompletionInterval="1000" ServicePath="~/WS/Service.svc" ServiceMethod="GetProductsByName"
EnableCaching="true" DelimiterCharacters=";" UseContextKey="true" OnClientItemSelected="txtProduct_ClientItemSelected">
</ajaxToolkit:AutoCompleteExtender>
并且更改下拉列表的 jquery 是:
function ddlStore_onchange() {
$('#acExt').set_contextKey($('#<%= ddlStore.ClientID %>').val());
}
它在 set_contextKey 函数上抛出错误。谁能解释我在这里做错了什么...
【问题讨论】:
标签: jquery asp.net autocompleteextender