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

[Solved] How to revive values from RadNumericTextBox using a Button

1 Answer 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nikola
Top achievements
Rank 2
Nikola asked on 21 Feb 2013, 12:33 PM
heey 

I'm sorry for that question but somehow I have a blackout (I know its not a excuse ) but how can I retrieve the value from a RadNumbericTextBox using a button to sent the value (I need a int)

my code 
<div class="fromRowDiv">
                <asp:Label ID="label1" CssClass="fromLabel" runat="server" Text="From Date" ></asp:Label>
                <telerik:RadNumericTextBox ID="FromDateNumbericTextBox" runat="server" MinValue="2000" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" ></telerik:RadNumericTextBox>  
                <asp:Label ID="Tolabel2" CssClass="fromLabel" runat="server" Text="To Date"></asp:Label>
                <telerik:RadNumericTextBox ID="ToDateNumericTextBox" runat="server" MinValue="2000" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator=""></telerik:RadNumericTextBox>   
            </div>

code behind

protected void CalcButton_Click(object sender, EventArgs e)
       {
           AnnualVacationManager mng = new AnnualVacationManager();
           mng.CalcForNextYear(2000,2001);
       }

 and i need here where the numbers 2000 and ,2001 is the values from the RadNumericTextBox's 


i really apologize my question but plzz help thanks 

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Feb 2013, 04:03 AM
Hi Nikola,

Try the following server side code to retrieve the value from the RadNumericTextBox.

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
    int _value1 = Convert.ToInt32(FromDateNumbericTextBox.Text);
    int _value2 = Convert.ToInt32(ToDateNumericTextBox.Text);
    AnnualVacationManager mng = new AnnualVacationManager();
    mng.CalcForNextYear(_value1, _value2);
}

Thanks,
Princy.
Tags
General Discussions
Asked by
Nikola
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or