textchanged event not firing

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?
 
N

Natty Gur

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top