0

I am developing a web application in which we have generated labels with barcode. Now we need to read these labels during packing stage.

I understand that Barcode scanners work as keyboard entry so I have created a View with text box to read the barcodes from labels. When I scan any label its reading barcode and automatically directing to some search page.

View

<td>
@Html.TextBoxFor(model => model.StyleNumber)
@* <input type = "text" style="border:0px;" value = "" />*@
</td>

There are 2 issues :

  1. Automatically append row with a text box with for each label

  2. Not to direct to some other page and have all the scanned labels on the same page to be read and used for further processing.

I have tried a lot but didn't find anything concrete. Please advise.

user3647327
  • 31
  • 2
  • 11

2 Answers2

1

I'd like to suggest to move in this direction:

  1. Obtain technical specification of barcode reader

  2. Barcode should add some "begin and ending char" before and after the barcode read Example if you barcode in 123456 reader can add 123456/n where /n is new line or something else

  3. You can monitor keydown of text field and monitor when text change and you detect ending character, at this point you can submit the form that contain your textbox. You can use javascript/Jquery http://www.aaronkjackson.com/2011/02/quick-tip-use-jquery-to-submit-a-textbox/ This example if the first that I've found but it can be improved for example sumitting a form without button

  4. You can perform barcode validation on server side

At this point you can process barcode on server side and return void from controller method. Y

You can improve solution providing some better user experince for example validating barcode client side or hide the text control or submit data using jquery insted of form like this: How to send data in jquery.post to mvc controller which use ViewModel as parameter?

Pay attention on setting focus over control otherwise if user ckick mouse out of text control the text read form barcode reader isn't inserted into textbox.

I think that could be possibile develop some ActiveX but this is more invasive solution

Community
  • 1
  • 1
0

HTML5 is your answer. But it will work in HTML5 compatible browser only. If you are targeting older version of browser you need to create Activex which is pretty old and not secure.

There is a jquery plugin for reading QR and Barcode which is worth looking into it. http://dwa012.github.io/html5-qrcode/

Another way is doing capturing it on mobile devices with HTML5 http://www.html5rocks.com/en/tutorials/getusermedia/intro/

There is a paid option also. http://www.visionsmarts.com/products/barcode-shell.html

Jalpesh Vadgama
  • 13,653
  • 19
  • 72
  • 94