1

我真的不明白這個問題。當我發佈我的asp.net 4.0網站時,它顯示這個錯誤。警告AjaxControlToolkit.AutoCompleteExtender.CompletionListElementID已過時:不是傳入CompletionListElementID,而是使用默認的

警告'AjaxControlToolkit.AutoCompleteExtender.CompletionListElementID'已過時:'不是傳入CompletionListElementID,而是使用默認的彈出窗口和使用CssClass屬性的樣式。'

現在我將提供它顯示爲警告的元素。

<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 2010中,C#4.0,Asp.net 4.0,Asp.net網站

回答

2

的問題是,你正在使用的AutoCompleteExtender的舊(過時)屬性。 CompletionListElementID屬性不再受支持。這些樣式屬性,你應該使用(從the AutoCompleteExtender documentation page):

  • CompletionListCssClass - CSS類將被用於設計完成列表彈出。
  • CompletionListItemCssClass - 將用於在自動完成列表彈出窗口中對項目進行樣式設置的Css類。
  • CompletionListHighlightedItemCssClass - 將用於在自動完成列表彈出框中爲高亮顯示的項目設置樣式的Css類。

注:CompletionListItemCssClass是已經取代CompletionListElementID

他們確實提供所有您需要的靈活性的一個。快樂的編碼!

相關問題