wsyeager
Centurion
I have two fields on my webform that I want calculated in my code-behind, but as I type in the controls, the events are not firing (as evidenced in debug mode).
<code>
Private Sub txtMileageBeginning_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMileageBeginning.TextChanged
If (txtMileageBeginning.Text.Trim <> String.Empty) AndAlso (txtEnding.Text.TrimEnd <> String.Empty) Then
txtTotal.Text = txtMileageBeginning.Text.Trim + txtEnding.Text.TrimEnd
End If
End Sub
Private Sub txtEnding_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEnding.TextChanged
If (txtMileageBeginning.Text.Trim <> String.Empty) AndAlso (txtEnding.Text.TrimEnd <> String.Empty) Then
txtTotal.Text = txtMileageBeginning.Text.Trim + txtEnding.Text.TrimEnd
End If
End Sub
</code>
How can I get these events to fire in order to dynamically calculate the total?
<code>
Private Sub txtMileageBeginning_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMileageBeginning.TextChanged
If (txtMileageBeginning.Text.Trim <> String.Empty) AndAlso (txtEnding.Text.TrimEnd <> String.Empty) Then
txtTotal.Text = txtMileageBeginning.Text.Trim + txtEnding.Text.TrimEnd
End If
End Sub
Private Sub txtEnding_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEnding.TextChanged
If (txtMileageBeginning.Text.Trim <> String.Empty) AndAlso (txtEnding.Text.TrimEnd <> String.Empty) Then
txtTotal.Text = txtMileageBeginning.Text.Trim + txtEnding.Text.TrimEnd
End If
End Sub
</code>
How can I get these events to fire in order to dynamically calculate the total?