Clearing a RadNumbericTextBox Server Side

3 posts, 1 answers
  1. Jamie
    Jamie avatar
    9 posts
    Member since:
    Dec 2008

    Posted 24 Jul 2009 Link to this post

    I want to clear (or set to 0) a textbox value from the server side.  I tried just setting the value = 0, or the text = "0", but it doesn't update.  The controls are inside of a RadAjaxPanel, so I have a feeling I need to set the RadNumericTextBox to update somehow.  With Anthem, it was just UpdateAfterCallback.

    Thanks,
    Jamie
  2. Answer
    Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 24 Jul 2009 Link to this post

    Hello Jamie,

    Please try the following code-snippet:
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Value="10" /> 
        <asp:Button ID="Button1" runat="server" Text="Clear" OnClick="Button1_Click" /> 
    </telerik:RadAjaxPanel> 

    protected void Button1_Click(object sender, EventArgs e) 
        RadNumericTextBox1.Value = 0; 

    The aforementioned code is working as expected at my side. Let me know what your findings are.

    Kind regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Jamie
    Jamie avatar
    9 posts
    Member since:
    Dec 2008

    Posted 24 Jul 2009 Link to this post

    That works... that was the code I had, but there was an Anthem button posting the submit.  Once I changed EnableCallBack to False instead of True on the Anthem button, everything worked fine.

    Thanks!
Back to Top