Our Customers
Contact Us Email: support@barcodelib.com
Home > ASP.NET Barcode > ASP.NET Barcode Generation Guide > Code 2 of 5 Barcode Generation Tutorial in ASP.NET
Download Barcode for ASP.NET Trial

ASP.NET Code 2 of 5 Barcode Generator Library

Tutorial for Code 2 of 5 Barcode Generation in ASP.NET Web Form
  • Completely support Code 2 of 5 barcode generation in .NET 2.0, 3.0, 4.0
  • Create standard Code 2 of 5 barcode quickly with integrated ASP.NET web barcode control
  • Create ASP.NET Code 2 of 5 barcode image using Visual C#.NET class
  • Create ASP.NET Code 2 of 5 barcode image using Visual Basic.NET class
  • Support flexible Code 2 of 5 barcode image formats, including JPEG, GIF, PNG, etc
  • A reliable ASP.NET Barcode Generator DLL supported by over 1000 developers
Code 2 of 5 Barcode Overview in ASP.NET
Code 2 of 5 is also known as 2 of 5 Industrial, 2/5 Industrial, 2 of 5 Standard, 2/5 Standard, Code 2/5, 2 of 5, C 2 of 5.
In telecommunication, Code 2 of 5 (two-out-of-five code) is an m of n code that provides exactly ten possible combinations. Thus it is popular for representing decimal digits using five bits. There are several ways to assign weights to each bit.
Example of Code 2 of 5 Barcode Creation in IIS
Here are simple steps for Code 2 of 5 barcode generation in IIS.
  1. Copy "barcode" folder and its contents in the unzipped trial package to your IIS folder.
  2. Create a new virtual directory named as barcode in your IIS.
  3. Link the virtual directory to the above "barcode" folder.
  4. Restart IIS and navigate to:
    http://YourDomain:port/barcode/linear.aspx?Type=6&Data=1423478954
Example of Code 2 of 5 Barcode Creation in ASP.NET Through Controller
Here are simple steps for Code 2 of 5 barcode generation in ASP.NET through controller.
  1. Download and unzip the trial package of ASP.NET Code 2 of 5 Barcode Generator.
  2. Add BarcodeLib.Barcode.ASP.NET.dll to the Toolbox.
  3. Go to "barcode" folder in the unzipped package and copy "linear.aspx" and "linear.aspx.cs" to your project folder.
  4. Drag and drop LinearASPNET to ASP.NET project in your Visual Studio.
  5. Select Code 2 of 5 in Type item under Properties window.
  6. Reset other properties of Code 2 of 5 through the Properties window and debug.
Example of ASP.NET Code 2 of 5 Barcode Creation in Web Forms
  1. Add reference (BarcodeLib.Barcode.ASP.NET.dll) to your ASP.NET project.
  2. Use the following C# and VB demo codes for Code 2 of 5 barcode generation.

Demo C# codes for Code 2 of 5 barcode generation in ASP.NET

     BarcodeLib.Barcode.Linear code25 = new BarcodeLib.Barcode.Linear();
code25.Type = BarcodeType.CODE2OF5;
code25.Data = "1423478954";

code25.UOM = UnitOfMeasure.PIXEL;
code25.BarWidth = 2;
code25.BarHeight = 80;
code25.ImageWidth = 320;
code25.ImageHeight = 100;

code25.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

// Save barcode image into your system
code25.drawBarcode("c://code25.png");

Demo VB codes for Code 2 of 5 barcode generation in ASP.NET

     Dim code25 As New BarcodeLib.Barcode.Linear()
code25.Type = BarcodeType.CODE2OF5
code25.Data = "1423478954"

code25.UOM = UnitOfMeasure.PIXEL
code25.BarWidth = 2
code25.BarHeight = 80
code25.ImageWidth = 320
code25.ImageHeight = 100

code25.ImageFormat = System.Drawing.Imaging.ImageFormat.Png

' Save barcode image into your system
code25.drawBarcode("c://code25.png")
More ASP.NET Barcode Types
Support Linear Barcodes:
Support Matrix Barcodes:
Other 2D Barcodes: Data Matrix, PDF 417, QR Code.



Other Related Barcode Generation Articles

ASP.NET C# & VB.NET Barcode Generation Guide