Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

ASPNET 1.1- Question regarding KeyPress Handler?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vagabond Software - 14 Feb 2006 16:33 GMT
I'm just getting started with ASP.NET, but I have a strong grasp of C# and
VB.NET.

When my ASPX page loads, I set focus to a text box that will be populated by
a barcode scanner.  All of that is working fine.

Once the barcode is scanned, I want to call my ProcessBarcode method without
the end-user needing to click anything or press the enter key.  I saw the
following example and added it to me page_load (if not postback) event, but
I'm a little lost on just how to consume this event handler in the
code-behind:

txtBarcode.Attributes.Add("OnKeyPress", "JavaScript:return handleEnter(this,
event, 1)")

In fact, I just pulled this from another post in this group and am not
entirely sure this is the right course to take.  Any help or suggestions
would be greatly appreciated.

carl
Kris - 14 Feb 2006 19:18 GMT
Hi Carl,

If you dont need to wait till user click or action, as soon as you
assign the textbox value call the ProcessBarcode method. Why you need a
event for this?

Otherwise if you are waiting for Enter key from user, I feel your
approach is right. Check whether the Key is "Enter" and call the
ProcessBarcode method.

Cheers,
Kris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.