我有两个文本框:TextBox1 和 TextBox2 都有日期。
我想在第三个文本框中获取日期差异,即 TextBox3。
我的代码是:
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
TextBox3.Text = ((Convert.ToInt32(TextBox1.Text) - Convert.ToInt32(TextBox2.Text)).ToString());
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
TextBox3.Text = ((Convert.ToInt32(TextBox1.Text) - Convert.ToInt32(TextBox2.Text)).ToString());
}