swtlbee

swtlbee

  • NA
  • 28
  • 0

easy! need to calculate one text box when the user enters data into another text box.

May 30 2009 5:31 PM
I have two text boxes and a C# method/function that will calculate the data of one text box when another is populated:
protected void calcMonthlyIncome()
    {
        appl_annualIncome = Convert.ToInt32;
        appl_monthlyIncome.Text = appl_annualIncome/12;
    }

What I need to know is in my text box how do I call the method/function once the user keys off or tabs off the text box(appl_annualIncome) he entered data into and set focus on the next textbox(appl_monthlyIncome) that will hold the calculated results.

<asp:TextBox ID="appl_annualIncome" runat="server" Width="140px"></asp:TextBox>
<asp:TextBox ID="appl_monthlyIncome" ReadOnly="true" runat="server" Width="140px" ></asp:TextBox>

Am new to the .net world - would appreciate any guidance. Thank you

Answers (3)