0

so on my webpage i have the following textbox

<asp:TextBox ID="txtFiltrarNomeUtente" runat="server" AutoPostBack="true" OnTextChanged="txtFiltrarNomeUtente_TextChanged">

and the handler

Protected Sub txtFiltrarNomeUtente_TextChanged(sender As Object, e As EventArgs) Handles txtFiltrarNomeUtente.TextChanged
  (code...)
End Sub

and this is working fine, but i noticed that the textchanged event only triggers after the user writed text and press enter or mouse click.So with this said i wanted to know if its possible to make a postback for the event to trigger everytime the text is changed, like everytime the user press a key without having to press enter or mouse click? thanks in advance

Hala mahala
  • 151
  • 2
  • 4
  • 20
  • Which key exactly? I see that you are using text changed which will only trigger once the user is done editing the textbox... – codeMonger123 Mar 15 '17 at 11:48
  • any key, i had this code on my vb application and now im adapting it to a web one, and whenever the user tipes anything on the textbox the event should trigger but in the web application it only triggers when the user types something and then presses enter or the mouse button... i just wanter to postback everytime a user types any letter on the keyboard – Hala mahala Mar 15 '17 at 11:53
  • is this even possible in the web applications? – Hala mahala Mar 15 '17 at 11:54
  • and i really dont know how could i explain eny better... – Hala mahala Mar 15 '17 at 11:54
  • Try this - http://stackoverflow.com/questions/1009086/how-to-make-an-asp-net-textbox-fire-its-ontextchanged-event-fire-in-an-ajax-upd – codeMonger123 Mar 15 '17 at 12:15
  • @codeMonger123 thank will check that out – Hala mahala Mar 15 '17 at 13:26
  • If you want to have an event on key press that is a different thing. ontextchanged only fires when the text box loses focus. Depending on what you are looking to do I would suggest using javascript to handle that on the client side. If you use the on key press event it's going to slow your site down significantly. – MaCron Mar 15 '17 at 14:21
  • well i needed it to be on the server side... but anyway, i will keep it this way so it wont slow my website – Hala mahala Mar 15 '17 at 14:48

0 Answers0