PDA

View Full Version : AutoComplete ویژه



mohsen musavi
پنج شنبه 30 دی 1389, 18:25 عصر
سلام دوستان عزیز
من از Autocomplete آژاکس استفاده کردم.می خوام بالای این کنترل یه DropDownList بزارم که اطلاعات این Autocomplete رو فیلتر کنه.دقیقا منظورم اینه که میخوام یه سری درس رو بر اساس گروه آموزشی فیلتر کنه.یعنی ابتدا گروه آموزشی رو در dropdownlist انتخاب کنه و سپس در autocomplete اطلاعات رو جستجو کنه
چطوری میتونم این کار رو انجام بدم.
اینم کد
<asp:DropDownList ID="drpTrainingGroup" runat="server" CssClass="txtInfoRight" >
<asp:ListItem>انتخاب کنید</asp:ListItem>
</asp:DropDownList>


<asp:TextBox runat="server" ID="txtCourseName" Width="300" autocomplete="off" AutoPostBack="true" />
<ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx1" ID="AutoCompleteExtender1"
TargetControlID="txtCourseName" ServiceMethod="GetCompletionListCourse" MinimumPrefixLength="2"
CompletionInterval="500" EnableCaching="false" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement"
CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
DelimiterCharacters="" ShowOnlyCurrentWordInCompletionListItem="true" FirstRowSelected="true"
OnClientItemSelected="autoComplete1_ItemSelected">
<Animations>
<OnShow>
<Sequence>

<OpacityAction Opacity="0" />
<HideAction Visible="true" />


<ScriptAction Script="
// Cache the size and setup the initial size
var behavior = $find('AutoCompleteEx1');
if (!behavior._height) {
var target = behavior.get_completionList();
behavior._height = target.offsetHeight - 2;
target.style.height = '0px';
}" />


<Parallel Duration=".0">
<FadeIn />
<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx1')._height" />
</Parallel>
</Sequence>
</OnShow>
<OnHide>

<Parallel Duration=".0">
<FadeOut />
<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx1')._height" EndValue="0" />
</Parallel>
</OnHide>
</Animations>
</ajaxToolkit:AutoCompleteExtender>