警告'AjaxControlToolkit.AutoCompleteExtender.CompletionListElementID'已过时:'使用默认的弹出框和使用CssClass属性的样式,而不是传入CompletionListElementID。'
现在我将提供它显示为警告的元素。
<ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx2" ID="AutoCompleteExtender4"
TargetControlID="txtPokemonName" ServicePath="AutoCompleteName.asmx" ServiceMethod="GetCompletionListPokemonName"
MinimumPrefixLength="1" CompletionInterval="500" EnableCaching="true" CompletionSetCount="25"
CompletionListCssClass="AutoExtender" CompletionListItemCssClass="AutoExtenderList"
CompletionListElementID="DIVAutoExtender2" CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true">
<Animations>
<OnShow>
<Sequence>
<OpacityAction Opacity="0" />
<HideAction Visible="true" />
<ScriptAction Script="
// Cache the size and setup the initial size
var behavior = $find('AutoCompleteEx2');
if (!behavior._height) {
var target = behavior.get_completionList();
behavior._height = target.offsetHeight - 2;
target.style.height = '0px';
}" />
<Parallel Duration=".4">
<FadeIn />
<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx2')._height" />
</Parallel>
</Sequence>
</OnShow>
<OnHide>
<Parallel Duration=".4">
<FadeOut />
<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx2')._height" EndValue="0" />
</Parallel>
</OnHide>
</Animations>
</ajaxToolkit:AutoCompleteExtender>
Visual Studio希望我修复什么以及为什么要显示此警告?
有什么想法吗?谢谢。
Visual Studio 2010,C#4.0,Asp.net 4.0,Asp.net网站
答案 0 :(得分:2)
问题是您使用的是AutoCompleteExtender
的旧(已弃用)属性。不再支持CompletionListElementID
属性。这些是您应该使用的样式属性(来自the AutoCompleteExtender documentation page):
注意: CompletionListItemCssClass
已取代CompletionListElementID
它们确实提供了您所需的所有灵活性。快乐的编码!