Streaming UPC-A Image into Your ASP.NET Web Pages
- Under downloaded trial package, copy barcode folder and its contents to your IIS, and create a new virtual directory, named "barcode".
- Restart IIS, navigate to http://YourDomain:Port/barcode/linear.aspx?DATA=12345678912&TYPE=36.
- To create barcode image in html or aspx pages, you can insert a image tag (img) into your web pages.
For example, <img src="http://YourDomain:Port/barcode/linear.aspx?DATA=12345678912&TYPE=36"/>
Generate UPC-A into Your ASP.NET Web Forms
- Install ASP.NET Barcode Generator Control.
- Add ASP.NET Barcode Generator Control to your Visual Studio ToolBox.
- Copy "linear.aspx" and "linear.aspx.cs" to the folder where your aspx pages are generating barcodes.
- Drag and drop "LinearWebForm" to your ASPX web forms.
- Run the website to view the barcodes generated. To customize UPC-A settings, view UPC-A barcode settings.
Generate UPC-A Barcodes in ASP.NET Class
If you need generate UPC-A barcodes in your ASP.NET class using C# or VB.NET, we provides complete barcode generation source code for UPC-A in C# and UPC-A in VB.NET.
UPC-A Barcode Customization in ASP.NET Projects
The OnBarcode library supports advanced UPC-A styling properties for ASP.NET applications.
Supported Customization Properties
Supported Customization Properties
- ShowQuietZoneIndicator: Show or hide the UPC-A quiet zone marker (default: true)
- UPCEANLeadDigitSpace: Set space between the first digit and the start bar (default: 0)
- UPCEANTrailDigitSpace: Set space between the stop bar and quiet zone indicator (default: 0)
- UPCEANLeadTrailDigitSizeRatio: Font size ratio for first/last digits vs. middle digits (default: 1.0f)
Hide UPC-A Quiet Zone Indicator
The quiet zone indicator is a small mark at the end of the barcode.
You can disable it in ASP.NET for cleaner UI design.
You can disable it in ASP.NET for cleaner UI design.
Adjust UPC-A Digit Spacing, Position and Font Size
You can fully customize the position and appearance of the first and last UPC-A digits.
This is widely used in ASP.NET retail dashboards and product label views.
Adjustable Properties:
Note: Extreme values for YShift or spacing may cause scanning failures. Always test barcodes in your Staging Environment before Deployment.
Adjustable Properties:
- UPCEANLeadDigitSpace: Horizontal space for the first digit
- UPCEANTrailDigitSpace: Horizontal space for the last digit
- UPCEANLeadDigitYShift: Vertical offset for the first digit
- UPCEANTrailDigitYShift: Vertical offset for the last digit
- UPCEANLeadTrailDigitSizeRatio: Font size scaling factor
Note: Extreme values for YShift or spacing may cause scanning failures. Always test barcodes in your Staging Environment before Deployment.
UPC-A Check Digit Calculation in ASP.NET
UPC-A uses the MOD 10 (module 10) algorithm to generate its check digit.
The barcode library automatically calculates the check digit if you provide 11 digits.
You can also implement manual validation in ASP.NET for Model Validation and data integrity checks.
Step-by-Step Check Digit Calculation
Step-by-Step Check Digit Calculation
- Start from the rightmost digit and mark positions as odd/even from right to left
- Sum all digits in odd positions and multiply the total by 3
- Sum all digits in even positions
- Add the two results together
- The check digit is the number required to make the total divisible by 10
- If the sum is already divisible by 10, the check digit is 0
Summary
You have completed the full workflow for generating, customizing, and validating UPC-A barcodes in ASP.NET projects.
This guide follows enterprise-level best practices and integrates seamlessly with ASP.NET Core, MVC, Razor Pages, Web API, and Blazor Server applications.
Key Contents
Key Contents
- Supports 11-digit (auto checksum) and 12-digit input formats
- Full customization support for quiet zone, digit spacing, vertical position, and font size
- Check digit uses MOD 10 algorithm, with built-in library calculation
- Ready for Production Environment, Deployment, and IIS/Kestrel hosting
