C# Barcode Generator in ASP.NET Application

How to create, print barcode label images for ASP.NET web applications with free C# barcode example source code

Using Free C# Souce Code to Generate Barcode Labels for ASP.NET Web Application & IIS Projects

In this tutorial, you learn how to generate barcode images in ASP.NET web applications

  • ASP.NET Web Forms
  • Web streaming in IIS
  • ASP.NET C# class
  • Barcode image with transparent background
  • Barcode data with non-printable chars
  • Barcode for GS1
  • Barcode for non-English text

How to create linear, 2d barcodes in ASP.NET using C#

  1. Download .NET Barcode Generator Suite
  2. Install C# library to create barcodes in ASP.NET
  3. Step by Step Tutorial

  • Advanced 1D & 2D C# Barcode Design Library for ASP.NET, MVC web applications
  • Easily generate and stream high print-quality barcode images to ASP.NET web pages (runtime)
  • Dynamically draw GTIN barcodes in C# class library for ASP.NET applications
  • All generated barcode images comply with the latest ISO/IEC or GS1 standards
  • Simple to print ASP.NET linear bar codes in C# sample code, like Code 39, Code 128, EAN/UPC, ITF-14, Interleaved 2 of 5, Postal barcodes and so on
  • Support encoding ASP.NET 2d barcode symbols in C# class, like QR Code, Micro QR Code, PDF-417, Micro PDF-417, and Data Matrix
  • Thermal printer support for C# ASP.NET bar coding with simple button click
  • Source code for C# barcode dll provided upon purchase of Unlimited Developer License
Barcode Generator Library for .NET is one of the best .NET Barcode Encoder Control SDK in the market. It completely integrates into ASP.NET C# (& Visual Basic) barcoding applications / web service, as well as Internet Information Services (IIS), C# barcode MVC. Besides, this popular ASP.NET barcode program supports creating linear & matrix barcodes in C# class library, C# Crystal Report.
Recommended here are some more Visual C#.NET barcode implementation tutorial:
  • Print C# Barcode - using C# to generate barcode in C# Class & Console projects with free barcode trial download
  • Draw C# Barcode WinForms - using C# to draw & paint multiple barcodes images in C# Windows Forms
  • Adjust C# Barcode Image - using C#.NET language to encrypt readable barcodes and adjust image properties
  • Encode C# Barcode Data - using C# to create GS1 barcode (with given number) or encode Unicode in barcode with C# programming

How to Generate, Print Barcode Label using C# in ASP.NET Web Forms Application

  1. Install Barcode Library DLL Solution for ASP.NET.
    Please add OnBarcode.Barcode.ASPNET.dll to your Visual Studio ASP.NET web project.
  2. Add Barcode Library dll component for ASP.NET to Visual Studio Toolbox.
    Right click Toolbox, select Choose Items..., and click Browse... to locate OnBarcode.Barcode.ASPNET.dll.
  3. Copy qrcode.aspx and qrcode.aspx.cs to the web project folder you created.
    Here, we take QR Code as an example. If you want to create linear or other 2d barcodes, please copy respective files to the project folder.
  4. Drag and drop QRCodeWebForm to your ASPX web forms and run the project.
    Then a QR Code is created on website page. Parameters are user-defined. Please view API details from QR Code property settings.

How to Generate Barcode in IIS Streaming using C#

  1. Copy barcode folder and its contents from the downloaded package to your IIS.
  2. Create a new virtual directory and name it barcode.
  3. Restart IIS and navigate to (QR Code encoding alphanumeric sample text): http://YourDomain:Port/barcode/qrcode.aspx?DATA=9876543210
  4. To display or preview a square QR Code image in html or aspx pages, you may directly use an image tag like the sample below:
    <img src="http://YourDomain:Port/barcode/qrcode.aspx?DATA=0123456789"/>

How to Generate Barcode in ASP.NET C# Class

OnBarcode provides complete C# demo codes for quick barcode label printing. Designers can edit settngs to encode barcode value (ie.string, characters or byte array), control barcode vector image (Gif, Jpeg, Png, Tiff formats) or bitmap, adjust barcode size (width, height) and color, auto check digit calculation. For namespace and method to use, please see the sample below.
  1. Verify that you have installed VS (Visual Studio) 2005, 2008 or 2010.
  2. Add Barcode Library DLL for ASP.NET to your ASP.NET C# project reference.
  3. Copy the C# syntax to your barcode system to create a unique QR Code barcode item on ASP.NET web page.
   // Create a ASP.NET QR Code object
QRCode qrCode = new QRCode();

// Customize QR Code barcode data
qrCode.Data = "ASP.NET C# QR Code";
// Customize QR Code data mode
qrCode.DataMode = QRCodeDataMode.Auto;

// Customize QR Code barcode size
qrCode.X = 2;
qrCode.LeftMargin = 8;
qrCode.RightMargin = 8;
qrCode.TopMargin = 8;
qrCode.BottomMargin = 8;

// Encode created QR Code to png image file and save it to C:\
qrCode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

How to generate barcode image with transparent background in asp.net using C#


In ASP.NET web streaming

To create transparent background barcode images in IIS asp.net web streaming, you shall apply the following http url properties.
  • FORE-COLOR: Barcode bar module color
  • TEXT-COLOR: The text color is usually the same as bar module color
  • BACK-COLOR: To set transparent background, the value should be "00000000"
  • FORMAT: The value should be "png"
Here is a sample url to create a Code 128 barcode image with transparent background in png image.

In ASP.NET C# class

To generate transparent background barcode image in ASP.NET C# class, please go to the C# barcode image generator how to page

How to encode, create non-printable chars in barcode images using asp.net c#

Some barcodes, such as Code 128, QR Code supports non-printable chars encoding. Here is an example to encode char 'CR' (Carriage Return).
  1. Set property ProcessTilde to true.
  2. Convert non-printable char to '~ddd' format. Here ddd is the char ASCII Integer code. 'CR' should be converted to '~013'.
  3. Set property Data to '~013'

How to encode, print GS1 data in barcodes using asp.net c#

The GS1 system originated in the United States and was established in 1973 by the Uniform Product Code Council, known until recently as the Uniform Code Council, Inc. (UCC) and since 2005 as GS1 US.

The following barcode symbologes support GS1 data encoding:
  1. EAN/UPC: UPC-A, UPC-E, EAN-13, and EAN-8 barcodes, and the two- and five-digit add-on symbols
  2. ITF-14
  3. GS1-128 (EAN-128)
  4. GS1 DataBar
  5. Composite Component symbols do not exist in isolation. The primary identification number is always encoded in the linear symbol and supplementary GS1 Application Identifier element strings are encoded in the two-dimensional (2D) component where they take up less space
  6. Data Matrix
  7. GS1 QR Code
Please read each barcode symbology guide page to encode GS1 data.

How to encode, print non-English chars (such as Thai, Arabic) in barcode images using c# in asp.net application

Most of the barcode types do not support encoding non-English text (such as Thai, Arabic) directly. To encode those chars, you need convert non-English chars into byte array, and encode byte array into barcode.

2D barcodes Data Matrix, PDF-417, QR Code support byte array data mode. Check each barcode symbology guide page to encode non-English chars.

C#.NET Barcode Generation Guides & Tutorials for Each Barcode


Barcode Control for C#.NET - Bar Code Type Generation

OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.