This is a migrated thread and some comments may be shown as answers.

[Solved] Clearing a RadNumbericTextBox Server Side

2 Answers 150 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Jamie asked on 24 Jul 2009, 06:28 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 24 Jul 2009, 08:58 PM
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.
0
Jamie
Top achievements
Rank 1
answered on 24 Jul 2009, 09:02 PM
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!
Tags
Input
Asked by
Jamie
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Jamie
Top achievements
Rank 1
Share this question
or