Closed cesartoro closed 7 years ago
Hi @cesartoro , Would you please clarify your scenario?
I need a autocomplete for textbox dinamically created. The autocomplete controller is also created dinamiclly from code behind.
I have this control created in aspx that works:
<ajaxToolkit:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="txtSearch"
ServiceMethod="GetCompletionList"
ServicePath="/Webservices/ClientesAutoComplete.asmx"
MinimumPrefixLength="1"
CompletionInterval="1000"
EnableCaching="true"
CompletionListCssClass="completionList"
CompletionListItemCssClass="listItem"
CompletionListHighlightedItemCssClass="itemHighlighted"
DelimiterCharacters=";,:">
<Animations>
<OnShow>
<Sequence>
<OpacityAction Opacity="0" />
<HideAction Visible="true" />
<Parallel Duration=".4"><FadeIn /></Parallel>
</Sequence>
</OnShow>
<OnHide>
<Sequence>
<OpacityAction Opacity="100" />
<HideAction Visible="false" />
<Parallel Duration=".4"><FadeOut /></Parallel>
</Sequence>
</OnHide>
</Animations>
</ajaxToolkit:AutoCompleteExtender>
And I need this working in code behind:
AjaxControlToolkit.AutoCompleteExtender ace = new AjaxControlToolkit.AutoCompleteExtender();
ace.ID = "autoComplete0" + i.ToString();
ace.ServiceMethod = "GetCompletionList";
ace.ServicePath = "/Webservices/ClientesAutoComplete.asmx";
ace.MinimumPrefixLength = 1;
ace.CompletionInterval = 1000;
ace.EnableCaching = true;
ace.CompletionListCssClass = "completionList";
ace.CompletionListItemCssClass = "listItem";
ace.CompletionListHighlightedItemCssClass = "itemHighlighted";
ace.DelimiterCharacters = ";,:";
//ace.Animations =
// "<OnShow> " +
// " <Sequence> " +
// " <OpacityAction Opacity = \"0\" /> " +
// " <HideAction Visible = \"true\" /> " +
// " <Parallel Duration = \".4\">< FadeIn /></Parallel> " +
// " </Sequence> " +
// " </OnShow> " +
// " <OnHide> " +
// " <Sequence> " +
// " <OpacityAction Opacity = \"100\" /> " +
// " <HideAction Visible = \"false\" /> " +
// " <Parallel Duration = \".4\"><FadeOut /></Parallel> " +
// " </Sequence> " +
// " </OnHide>";
In the ace.Animations attibution the asp.net generates a exception:
{"Invalid Animation definition for TargetControlID=\"\": Um nome não pode ser iniciado pelo caractere ' ', valor hexadecimal 0x20. Linha 1, posição 155."}.
Thanks!!
I was missing the TargeControlID, but the problem presists with it,
@cesartoro < FadeIn />
tag is invalid - it has a space after the opening angle bracket.
Remove the space so you can assign the Animation value without errors.
Thank you.
The code is running.
How use animation for autcomplete dinamically?