I've got an asp:TextArea
that I would like to do some processing (filtering a list) as the user types. I'm sure I could do the filtering within a javascript function called via the onkeyup event, but I'd prefer to do it in my VB.NET code.
Is it possible to do such a thing, or should I just stick with the Javascript? If the latter, could you please explain why?
Thanks!
Stick to the javascript, for one simple reason: postback will lag.
Think about how fast you type. And think about how fast your server responds when a postback is submitted. Now, what will happen when the user types "Hello, world!" in two seconds? He'll get to "Hell" and then the browser will load the postback response. And the user will be back at "H". If every time your user tries to type something you delete a couple of letters, he'll hate your interface.
Doing it with javascript isn't harder than doing it with VB.Net - use jQuery or some other javascript library that makes your life easy, and you'll be filtering that list without keeping your users waiting.