How to revive values from RadNumericTextBox using a Button

2 posts, 1 answers
  1. Nikola
    Nikola avatar
    65 posts
    Member since:
    Sep 2012

    Posted 21 Feb 2013 Link to this post


    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>   

    code behind

    protected void CalcButton_Click(object sender, EventArgs e)
               AnnualVacationManager mng = new AnnualVacationManager();

     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 
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Feb 2013 Link to this post

    Hi Nikola,

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

    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);

Back to Top