I've been forcing myself to focus on really diving into the meat of the ASP.NET AJAX framework, and today I had a breakthrough moment.
Unless you've been living under a rock, you know that the framework allows you to declaratively contain normal ASP.NET stuff in an update panel container, and the post-back stuff that normally happens on a page, refreshing the whole thing, automagically just updates a little area of the page instead. Almost no new learning required. Sweet.
The code for use in the page is simple, and every key stroke in the text box calls the server, and the server redraws the contents of the Label:
<asp:TextBox ID="MyText" runat="server" AutoComplete="off" AutoPostBack="true" OnTextChanged="MyText_TextChanged" />
<sample:KeypressExtender ID="KeyPressExtender" runat="server" TargetControlID="MyText" MinimumCharacters="2" />
<asp:UpdatePanel ID="MyUpdate" runat="server" RenderMode="block">
<p><asp:Label ID="Result" runat="server" /></p>
<asp:AsyncPostBackTrigger ControlID="MyText" />