-
Jan 21st, 2013, 04:50 PM
#1
Thread Starter
Junior Member
[RESOLVED] VS 2010 textbox text change
Hello a very simple question that I just can't seem to figure out.
The text change event only fires when I hit enter.
It doesn't fire every time I enter a character.
Any help is appreciated!
Code:
Protected Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
MsgBox("test")
End Sub
JO
-
Jan 22nd, 2013, 12:38 AM
#2
Re: VS 2010 textbox text change
What "enter" will do is validate the textbox, thus run server code.If that would have happened with text change then it would mean that on every key press you would postback to the server so as a side effect your page would load every time you pressed a key.
What you want is mostly controlled with 2 ways i can think right now.
1)Use javascript or Jquery to catch the textbox text changing and do something.
2)Use an html text input element and use one of it's keysomething events to run a js fucntion:
Code:
<input id="Text1" type="text" onkeydown="javasfunction()" />
Last edited by sapator; Jan 22nd, 2013 at 01:16 AM.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jan 22nd, 2013, 11:19 AM
#3
Thread Starter
Junior Member
Re: VS 2010 textbox text change
Thanks for the reply the code you posted worked great
JO
-
Jan 22nd, 2013, 06:58 PM
#4
Re: [RESOLVED] VS 2010 textbox text change
No problem.I suppose you found a js function(?)
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|