I'm using an UpdatePanel to asynchronously update a control on my ASP.NET page. During the postback, I'd like to get the value of a TextBox control. The value I get, however, is always the original text value of the TextBox, not the text the user has inputted. How can I get the updated value of the TextBox server-side on a postback?
Thanks in advance for any advice you have to offer.
Here's the code:
<asp:UpdatePanel ID="GridUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="AdminGridView" runat="server"
onrowcreated="AdminGridView_RowCreated" AutoGenerateColumns="False"
RowStyle-HorizontalAlign="Center" CssClass="Grid" Font-Size="100%"
BorderColor="Black" oninit="AdminGridView_Init">
</asp:GridView>
<asp:TextBox ID="SortLabel" runat="server" Text="Recipients"></asp:TextBox>
<asp:TextBox ID="DirectionLabel" Text="DESC" runat="server"></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>
--EDIT--
I should add that I'm attempted to retrieve the value of the TextBox in the _Init() Event in the GridView - maybe there's a better place to retrieve the value of the TextBox?