textchanged event not firing

  • Thread starter Thread starter bill yeager
  • Start date Start date
B

bill yeager

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?
 
Hi,

1) Did you set autopostback to true?
2) It sounds that you expect event to occur while you typing in text
box. This event occurred when the user will leave changed textbox.
Imagine that for every character that you will enter to textbox request
to the server will be made.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Back
Top