本文介绍了默认为第四个文本框中的三个文本框的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此aspx页位于内容占位符下,不支持javascript
如何解决这个问题

this aspx page is under content place holder not supported javascript
how to resolve this probles

 protected void txtOSITotalIncome_TextChanged(object sender, EventArgs e)
{
     string no1 = txtOSIInterstFromBank.Text;
     string no2 = txtOSITDSFromBank.Text;
     string no3 = txtOSIInterestFromDebent.Text;
     txtOSITotalIncome.Text = (no1 + no2 + no3);

}

推荐答案

int number1 = 0;
int number2 = 0;
int number3 = 0;
int.TryParse(OSIInterstFromBank.Text, out number1);
int.TryParse(txtOSITDSFromBank.Text, out number2);
...


string + string = stringstring  <br />
int + int + int = SumOf3int<br />
number + number = SumOf2numbers



您看到我要告诉"您的内容吗?

要添加3个数字,您需要声明数字变量,然后将其转换为字符串.



Do you see what i''m trying to "tell" you?

To add 3 numbers you need to declare number variable, then convert it into string.


int no1 = Convert.ToInt32(txtOSIInterstFromBank.Text);
int no2 = Convert.ToInt32(txtOSITDSFromBank.Text);
int no3 = Convert.ToInt32(txtOSIInterestFromDebent.Text);
int no4 = (no1 + no2 + no3);

txtOSITotalIncome.Text=no4.ToString();



快乐编码:)



Happy Coding :)


这篇关于默认为第四个文本框中的三个文本框的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 15:04