Problem while using Ajax implemented user control
Hi guys,
I am using Ajax in a user control. My user control contains one textbox and one dropdownlist. The dropdownlist is filled on the basis of text written in the textbox. This is running fine with atlas and my code is
<asp:Panel ID="speedSearchPanel" runat="server">
<ajax:ScriptManager ID="speedSearchScriptManager" runat="server" OnAsyncPostBackError="SpeedSearchScriptManagerAsyn cPostBackError" />
<ajax:UpdatePanel ChildrenAsTriggers="false" RenderMode="inline" ID="speedSearchUpdatePanel" UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<asp:TextBox ID="searchTextBox" runat="server" CssClass="MediumTextBox" AutoPostBack="true"
OnTextChanged="SearchTextBoxTextChanged" Width="100px" />
<asp:DropDownList ID="searchResultDropDownList" CssClass="DropDownList" runat="server"
Width="220px" />
</ContentTemplate>
<Triggers>
<ajax:AsyncPostBackTrigger ControlID="searchTextBox" EventName="TextChanged" />
</Triggers>
</ajax:UpdatePanel>
</asp:Panel>
Now, I have to use this control on a .aspx page that contains textboxes that are to be filled when selected index of the dropdown is changed.
To Implement this I modified the above code as below
<asp:Panel ID="speedSearchPanel" runat="server">
<ajax:ScriptManager ID="speedSearchScriptManager" runat="server" OnAsyncPostBackError="SpeedSearchScriptManagerAsyn cPostBackError" />
<ajax:UpdatePanel ChildrenAsTriggers="false" RenderMode="inline" ID="speedSearchUpdatePanel" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:TextBox ID="searchTextBox" runat="server" CssClass="MediumTextBox" AutoPostBack="true" OnTextChanged="SearchTextBoxTextChanged" Width="100px" />
<asp:DropDownList ID="searchResultDropDownList" CssClass="DropDownList" runat="server" OnSelectedIndexChanged="GetData" Width="220px" />
</ContentTemplate>
<Triggers>
<ajax:AsyncPostBackTrigger ControlID="searchTextBox" EventName="TextChanged"/>
<ajax:AsyncPostBackTrigger ControlID="searchResultDropDownList" EventName="GetData" />
</Triggers>
</ajax:UpdatePanel>
</asp:Panel>
But this is not solving my problem.
And when I used PostBackTrigger for searchResultDropDownList, it worked but the page refreshed.
I want the textboxes of .aspx page to be filled on the change event of searchResultDropDownList with the data it is fetching from database.
|