ASP.NET - Update Panel Not Work Properly
Asked By ALOK RANJAN on 29-Jun-12 02:11 AM
hi everyone,
I have scenario that I am using Jquery Autosuggest in my Search portal Application like this
<asp:UpdatePanel ID="update4" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:TextBox ID="txtsearch" runat="server" CssClass="autosuggest" class="ddl"
Style="width: 400px; height: 22px; border-style: ridge; background-color: #EDEDED;
z-index: 1000" ontextchanged="txtsearch_TextChanged" AutoPostBack="True" ></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
But It is not working plz help me and giving error
Thanks & Best Regrads
ALOK RANJAN
Vikram Singh Saini replied to ALOK RANJAN on 29-Jun-12 02:51 AM
Register txtSearch as AsyncPostBackTrigger control in UpdatePanel as:
<asp:UpdatePanel ID="upanel" runat="server">
<ContentTemplate><asp:TextBox ID="txtsearch" runat="server" CssClass="autosuggest" class="ddl"
Style="width: 400px;
height: 22px; border-style: ridge; background-color: #EDEDED;
z-index: 1000"
ontextchanged="txtsearch_TextChanged" AutoPostBack="True"
></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtsearch" />
</Triggers>
</asp:UpdatePanel>
Sometimes server controls don't work in UpdatePanel and we need to register them as we have done in above code. Let us know if it helped you or not.