Barcode in asp.net MVC (display as image in html)
View (DisplayBarcode.cshtml) should be like the following
Barcode can be generated very easily using zxing. Zxing is open source library which supports decoding and generating of barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar) within images.

Install Zxing.net from Nuget
The following barcodes are supported by the decoder:
UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417.
The encoder supports the following formats:
UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix
Steps for generating barcode.
Add the following Action Methods to your controller.
Install Zxing.net from Nuget
The following barcodes are supported by the decoder:
UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417.
The encoder supports the following formats:
UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix
Steps for generating barcode.
- Create a new MVC Project
- Right click on project in solution explorer and click. Manage nuget Packages
- click on browse tab. Search for zxing.net
- Click on install button on right side
1 | using MVC_CRUD_ADO.DAL; |
View (DisplayBarcode.cshtml) should be like the following
1 | @{ |
0 Comments