There was a strange problem. I have a simple page with a TextBox :
<asp:ScriptManager runat="server" /> <asp:UpdatePanel runat="server"> <ContentTemplate> <asp:TextBox ID="amountTextBox" runat="server" TextMode="Number" /> <asp:Button runat="server" Text="Confirm" OnClick="confirmButton_Click" /> </ContentTemplate> </asp:UpdatePanel>
After Button click, I will try to get the TextBox value:
public partial class test : Page { protected void confirmButton_Click(object sender, EventArgs e) { var answer = amountTextBox.Text; } }
but it is empty. If I remove UpdatePanel , I can get the value. If I leave the UpdatePanel and remove the TextMode property, I can get the value. But why can't I set TextBoxt from TextMode to Number in UpdatePanel ?
source share