JavaScript .NET 4.0无法找到AutoCompleteExtender控件 [英] AutoCompleteExtender control cannot be found by JavaScript .NET 4.0
问题描述
大家好,
我试图通过Javascript设置AutoComplete扩展器的ContextKey但是找不到控件。我正在使用.Net 4.0并且AutoCompleteExtender位于Accordion Control内。
我试图使用
1)
Hi guys,
I am trying to set the ContextKey of an AutoComplete extender by Javascript but the control cannot be found. I am using .Net 4.0 and the AutoCompleteExtender resides inside an Accordion Control.
I have tried to using
1)
$find('autorextenderID').set_contextKey
2)
2)
$find('autorextender''s BehaviourID').set_contextKey
3)的
3)
var e = document.getElementById('<% = AutoCompleteExtenderPortOfUnlading.ClientID %>');
e.set_contextKey($('#<%= ddlDestinationCountry.ClientID %>').val());
也使用
Also played with the
<httpRuntime encoderType />
禁用Web上的编码.Config并且没有一个工作。
如何正确设置ContextKey?
谢谢。
to disable the encoding on the Web.Config And none of them worked.
How can I set the ContextKey on properly?
Thanks.
<div class="row">
<div class="label">
<asp:Label ID="lblPortOfUnlading" runat="server" style="display:none;" Text="Port of Unlading:"></asp:Label>
</div>
<div class="value">
<asp:TextBox ID="txtPortOfUnlading" runat="server" style="display:none;" onkeyup="SetContextKey();" Width="256px" AutoCompleteType="Search"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender
runat="server"
ID="AutoCompleteExtenderPortOfUnlading"
BehaviorID="AutoCompleteEx"
DelimiterCharacters="" Enabled="True"
ServiceMethod="GetPortOfUnladingByCountry"
CompletionListCssClass="completionListElement"
CompletionListItemCssClass="listItem"
CompletionListHighlightedItemCssClass="highlightedListItem"
ServicePath=""
TargetControlID="txtPortOfUnlading"
UseContextKey="True"
></ajaxToolkit:AutoCompleteExtender>
</div>
</div>
<script type="text/javascript" language="javascript">
function SetContextKey() {
var e = document.getElementById('<% = AutoCompleteExtenderPortOfUnlading.ClientID %>');
e.set_contextKey($('#<%= ddlDestinationCountry.ClientID %>').val());
}
推荐答案
find('autorextenderID')。set_contextKey
find('autorextenderID').set_contextKey
2)
2)
find('autorextender''s BehaviourID')。set_contextKey
find('autorextender''s BehaviourID').set_contextKey
3)的
3)
var e = document.getElementById('<% = AutoCompleteExtenderPortOfUnlading.ClientID %>');
e.set_contextKey(
('#<% = ddlDestinationCountry.ClientID %> ')。val());
('#<%= ddlDestinationCountry.ClientID %>').val());
也使用
Also played with the
<httpRuntime encoderType />
禁用Web上的编码.Config并且没有一个工作。
如何设置ContextKey正确吗?
谢谢。
to disable the encoding on the Web.Config And none of them worked.
How can I set the ContextKey on properly?
Thanks.
<div class="row">
<div class="label">
<asp:Label ID="lblPortOfUnlading" runat="server" style="display:none;" Text="Port of Unlading:"></asp:Label>
</div>
<div class="value">
<asp:TextBox ID="txtPortOfUnlading" runat="server" style="display:none;" onkeyup="SetContextKey();" Width="256px" AutoCompleteType="Search"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender
runat="server"
ID="AutoCompleteExtenderPortOfUnlading"
BehaviorID="AutoCompleteEx"
DelimiterCharacters="" Enabled="True"
ServiceMethod="GetPortOfUnladingByCountry"
CompletionListCssClass="completionListElement"
CompletionListItemCssClass="listItem"
CompletionListHighlightedItemCssClass="highlightedListItem"
ServicePath=""
TargetControlID="txtPortOfUnlading"
UseContextKey="True"
></ajaxToolkit:AutoCompleteExtender>
</div>
</div>
<script type="text/javascript" language="javascript">
function SetContextKey() {
var e = document.getElementById('<% = AutoCompleteExtenderPortOfUnlading.ClientID %>');
e.set_contextKey(
这篇关于JavaScript .NET 4.0无法找到AutoCompleteExtender控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!