大家来帮我看看,为什么下面的事件没有被执行?
protected void txtDigital_TextChanged(object sender, EventArgs e)
{
RangeValidator2.MaximumValue = ValidateInput(txtDigital, txtOther).ToString();
RangeValidator2.ErrorMessage = string.Format( "0-{0}的整数 ", RangeValidator2.MaximumValue);
}
protected void txtOther_TextChanged(object sender, EventArgs e)
{
RangeValidator1.MaximumValue = ValidateInput(txtDigital, txtOther).ToString();
RangeValidator1.ErrorMessage = string.Format( "0-{0}的整数 ", RangeValidator1.MaximumValue);
}
public int ValidateInput(TextBox Digital, TextBox Other)
{
int iDigital = Convert.ToInt32(Digital.Text.Length > 0 ? Digital.Text : "0 ");
int iOther = Convert.ToInt32(Other.Text.Length > 0 ? Other.Text : "0 ");
if (iOther == 0)
{
lblDigital.Text = "0-4 ";
lblOther.Text = string.Format( "0-{0} ", 48 - iDigital);
return 48 - iDigital;
}
else if (iDigital == 0)
{
lblOther.Text = "0-48 ";
if (iOther > = 44 && iOther <= 48)
{
lblDigital.Text = string.Format( "0-{0} ", 48 - iOther);
return 48 - iOther;
}
else
&nbs