TextChange Event

Hiteshkumar Patel 21 Reputation points
2022-05-09T08:52:28.62+00:00

Hi All,
I created one small web application to scan barcode with one text box and one list view for our scanning device previously we are using window CE device. In this device i have option to press enter key automatically. But now we are upgrade our device which came with android and there is no option for enter key I try OnTextChanged even with AutoPostBack = true but its not work for me until and i press sum ware in page. basically this event is work like lost focus. i want behave like keypress event
Can any one help me about this

Thanks in Advance.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,246 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2022-05-09T20:05:58.227+00:00

    the OnTextChanged event is a server event. AutoPostBack javascript does a form submit when the textbox loses focus. you will need to implement your own javascript autopostback based on the keypress event.

    hint: if you do not know the number of characters from the reader, then just use a watchdog timer. say 100ms since last char typed or field length changed.

    0 comments No comments

  2. Yijing Sun-MSFT 7,066 Reputation points
    2022-05-10T02:13:00.383+00:00

    Hi @Hiteshkumar Patel ,
    Why you don't use keypress event? I suggest you could write a hidden button and then you could press "Enter" key to trigger the event. Just like this:
    In this, I use the javascript.
    200464-new-text-document.txt
    201324-screenshot-2022-05-12-161136.png
    201325-screenshot-2022-05-12-161221.png

    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments