I have a search button attached to the update panel as a trigger:
<asp:Panel ID="CRM_Search" runat="server">
<p>Search: <asp:TextBox ID="CRM_Search_Box" CssClass="CRM_Search_Box" runat="server"></asp:TextBox>
<asp:Button ID="CRM_Search_Button" CssClass="CRM_Search_Button" runat="server" Text="Search" OnClick="SearchLeads" /></p>
</asp:Panel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="CRM_Search_Button" />
</Triggers>
<ContentTemplate>
/* Content Here */
</ContentTemplate>
</asp:UpdatePanel>
In my javascript, I use jQuery to capture the search box and snap it to the keyboard so that the search button clicks:
$($(".CRM_Search_Box")[0]).keyup(
function () {
$($(".CRM_Search_Button")[0]).click();
}
);
This works fine except when I type too fast. As soon as I type too fast (I think if it is faster than the data will actually return), the whole page is refreshed (by doing a postback?) Instead of the update panel.
I also found that instead of entering text, if I just quickly press a button, it starts to do the same.
? , 2- , ? , - ?
,
Matt