ASP.NET Code 128 Generator Library SDK

Integration & Developer Guide to generate Code 128 barcode images in ASP.NET Server

Generate barcode Code 128 images in Visual ASP.NET web application with complete sample .NET source code

  • Generate, create Code 128 in Visual Studio ASP.NET applications
  • Easy to install & integrate barcode Code 128 generation library SDK into ASP.NET developments
  • Generate industry standard linear, 2d barcode types including ASP.NET QR Code, ASP.NET Data Matrix, ASP.NET EAN-128, ASP.NET Code 39
  • Generate Code 128 images in ASP.NET C# class
  • Create barcode Code 128 in ASP.NET webform application
  • Draw & print Code 128 in SQL Server Reporting Service (SSRS) & Crystal Reports for ASP.NET projects
  • Code 128 check digit will be enabled without calculation
  • Easy to encode Code 128 images to jpeg, gif, png, tiff, bitmap files in ASP.NET program
Here we will learn how to generate, print Code 128 barcodes in ASP.NET Web Applications using C#. It covers core barcode encoding rules, code set configuration, function character handling, check digit logic, human-readable text customization, dimension settings, and GS1 data integration.

  • Full explanation of Code 128 character sets, encoding rules, and supported character ranges for ASP.NET integration
  • Configuration of Code 128 code sets (auto/manual) and function characters in ASP.NET C# code
  • Check digit generation logic and non-applicable properties for Code 128 in ASP.NET
  • Customization of Code 128 Human Readable Interpretation (HRI) and barcode dimensions for ASP.NET web rendering
  • GS1 data encoding support for Code 128 barcodes in ASP.NET applications

ASP.NET Code 128 Generator DLL Introduction

Top
ASP.NET Code 128 Generator is one of the barcode generation functions in OnBarcode's Barcode for ASP.NET Generation Controls, which generates & prints Code 128 and 20+ other linear & 2D bar codes in ASP.NET web applications.
This article is providing several methods to use ASP.NET Barcode Generation Control to generate Code 128 barcodes in ASP.NET web pages, ASP.NET web forms, and ASP.NET classes.

Code 128 Generators

OnBarcode provides several Code 128 Generator components and software, such asCode 128 Generator for .NET,Code 128 Generator for Java,Code 128 Generator for C#,Code 128 Generator for VB.NET,Code 128 Generator.


Streaming Code 128 Image into Your ASP.NET Web Pages

Top
  • 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=CODE128&TYPE=7.
  • 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=CODE128&TYPE=7"/>

Generate Code 128 into Your ASP.NET Web Forms

Top
  1. Install ASP.NET Barcode Generator Control.
  2. Add ASP.NET Barcode Generator Control to your Visual Studio ToolBox.
  3. Copy "linear.aspx" and "linear.aspx.cs" to the folder where your aspx pages are generating barcodes.
  4. Drag and drop "LinearWebForm" to your ASPX web forms.
  5. Run the website to view the barcodes generated. To customize Code 128 settings, view Code 128 barcode settings.

Generate Code 128 Barcodes in ASP.NET Class

Top
If you need generate Code 128 barcodes in your ASP.NET class using C# or VB.NET, we provides complete barcode generation source code forCode 128 in C# and Code 128 in VB.NET.


Code 128 Barcode Data Character Encoding in ASP.NET

This section defines the supported character sets and encoding rules for Code 128 in your ASP.NET project.

Code 128 supports the following character sets for ASP.NET barcode encoding:
  • All 128 full ASCII characters defined in ISO/IEC 646
  • Extended ASCII characters (ISO/IEC 8859-1, Latin Alphabet 1, values 128–255) using the FNC4 function character
  • 4 non-data function characters for specialized operations
  • 4 code set selection characters for dynamic encoding
  • 3 unique start characters to initialize barcode generation
  • 1 mandatory stop character to terminate the barcode



Code 128 Data Code Sets in ASP.NET

Code 128 uses three dedicated code sets to optimize data density, configurable in your ASP.NET C# code.
  • Code Set A: Supports uppercase letters, numbers, and control characters
  • Code Set B: Supports uppercase/lowercase letters and standard symbols
  • Code Set C: Supports numeric-only data (double-density encoding)

Auto Mode (Recommended for ASP.NET)

  • Set the Type property to BarcodeType.CODE128
  • The library automatically selects the optimal code set for your data

Manual Mode

  • BarcodeType.CODE128A: Force Code Set A
  • BarcodeType.CODE128B: Force Code Set B
  • BarcodeType.CODE128C: Force Code Set C
Note: Manual code set selection may cause encoding failures if your data does not match the set's supported characters. Use auto mode for most ASP.NET scenarios.


Code 128 Function Characters (FNC) in ASP.NET

Function Characters (FNC) are special non-data symbols that trigger device operations in barcode scanners integrated with ASP.NET applications.

Supported FNC characters:
  • FNC1: Used for GS1 system integration (GS1-128 standard)
  • FNC2: Enables barcode message append functionality
  • FNC3: Triggers barcode reader initialization/reprogramming
  • FNC4: Encodes extended ASCII characters (ISO/IEC 8859-1)
ASP.NET Implementation
  • No manual input of FNC characters is required in your ASP.NET code
  • The barcode library automatically encodes function characters based on your data
  • No additional configuration is needed for standard web app scenarios


Code 128 Check Digit Logic in ASP.NET

Code 128 includes a mandatory check digit (checksum) calculated using the Modulo 103 algorithm for data integrity in ASP.NET applications.
  • The check digit is auto-generated and cannot be disabled
  • It is not visible in the Human Readable Interpretation (HRI)
  • Barcode decoders do not return the check digit as usable data
  • The AddCheckSum property is not applicable to Code 128


Code 128 Human Readable Interpretation (HRI) in ASP.NET

Human Readable Interpretation (HRI) is the plain text displayed alongside the Code 128 barcode, rendered in your ASP.NET View / Razor Pages output.

To display HRI above the Code 128 symbol in ASP.NET, you must set a negative TextMargin value. Incorrect values will cause text overlapping or missing rendering.



Code 128 Dimension & Size Settings in ASP.NET

Customize barcode dimensions to fit your ASP.NET Layout, View Component, or Partial View design requirements.

Configurable Properties:
  • UOM (Unit of Measure): Supports PIXEL, CM, INCH for ASP.NET rendering
  • X: Width of the narrowest barcode module (minimum defined by your application spec)
  • Y: Total height of the barcode bars
  • LeftMargin / RightMargin: Quiet zones (minimum width = 10X for scan compatibility)



Note: Maintain a minimum quiet zone of 10X in your ASP.NET project. Insufficient margins will cause barcode scanning failures in production environments.


Summary

This guide fully covers the details of generating Code 128 barcodes in ASP.NET and ASP.NET Core projects, from basic implementation to advanced configuration. You learned to integrate barcode generation into the ASP.NET request pipeline, configure character sets, manage HRI and dimensions, handle check digits, and implement GS1 encoding. By following the structured workflow, you can deploy reliable, standards-compliant Code 128 barcode functionality to your ASP.NET Web App, MVC, Razor Pages, or Web API.








































Start with free trial package:








































Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.