1: <asp:TextBox ID="txtProducts" runat="server" Height="21px" Width="334px"></asp:TextBox>
2:
3: <cc1:AutoCompleteExtender runat="server"
4: BehaviorID="AutoCompleteEx"
5: ID="e_Products" TargetControlID="txtProducts" ServicePath="AutoCompleteRows.asmx" OnClientPopulated="selectItem"
6: ServiceMethod="GetProducts" MinimumPrefixLength="2" CompletionInterval="1000"
7: EnableCaching="true" CompletionSetCount="8"
8: CompletionListCssClass="autocomplete_completionListElement"
9: CompletionListItemCssClass="autocomplete_listItem"
10: CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
11: <Animations>
12: <OnShow>
13: <Sequence>
14: <% 1: -- Make the completion list transparent and then show it --
%>
15: <OpacityAction Opacity="0" />
16: <HideAction Visible="true" />
17:
18: <% 1: --Cache the original size of the completion list the first time
2: the animation is played and then set it to zero --
%>
19:
20: <ScriptAction Script=" />
21: // Cache the size and setup the initial size
22: var behavior = $find('AutoCompleteEx');
23: if (!behavior._height) {
24: var target = behavior.get_completionList();
25: behavior._height = target.offsetHeight - 2;
26: target.style.height = '0px';
27: }"
28:
29: <% 1: -- Expand from 0px to the appropriate size while fading in --
%>
30:
31: <Parallel Duration=".4">
32: <FadeIn />
33: <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
34: </Parallel>
35: </Sequence>
36: </OnShow>
37: <OnHide>
38: <% 1: -- Collapse down to 0px and fade out --
%>
39:
40: <Parallel Duration=".4">
41: <FadeOut />
42: <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
43: </Parallel>
44: </OnHide>
45: </Animations>
46: </cc1:AutoCompleteExtender>