KA.Barcode for ASP.NET
How to Print Code 39 in ASP.NET with Valid Data
Complete ASP.NET source code to generate, print Code 39 images using Barcode Generator for ASP.NET
  • Compatible with Visual Studio 2005 and greator & .NET Framework 2.0, 3.0, 3.5 and above
  • Easy to add Code 39 1D barcode generating & printing features in ASP.NET web applications
  • Create & stream linear Code 39 Extended barcode for all ASCII in ASP.NET webform as well
  • Insert linear and GS1 barcodes , such as Interleaved 2 of 5 ASP.NET, Word EAN-8, Codabar C#, EAN-13 VB.NET, in your applications
  • Simple Code 39 generation through settings in URL and include barcodes in a web page with < IMG > tag
  • Efficiently & accurately generating Code 39 to insert into ASP.NET website with C# & VB.NET programming
  • Encode, make multiple Code 39 1D barcodes according to ISO / IEC 16388 (2nd edition)
  • Complete user manual for encoding Code 39 valid character sets
  • Supports Excel Data Matrix , ITF-14 Java, Interleaved 2 of 5 Excel, Excel Intelligent Mail and many other barcode types
  • Automatically add a computing check digit to Code 39 bar codes according the algorithm in standard
Code 39 Barcode Generator for ASP.NET is a mature and easy to use Code 39 generator control plugin software for creating/ printing Code 39 pictures and other linear, bidimensional barcodes in ASP.NET applications, VB.NET, C# .NET, and Microsoft Internet Information Service. This article explains how to encode Code 39 valid characters in ASP.NET and insert barcodes in web pages/webforms, IIS; other Code 39 barcode related setting, please see:
Code 39 Information
Code 39, a widely-used linear barcode symbology specified by ISO/IEC specification, is also named 3 of 9 Barcode, ASNI/AIM Code 39, USD-3, USS Code 39, Code 3/9, Code 3 of 9, USD-3, Code 39 Extended.

Code 39 for ASP.NET encodes:

  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Uppercase letters (A - Z)
  • - (Dash), $ (Dollar), % (Percentage), (Space), . (Point), / (Slash), + (Plus)

Code 39 Extension for ASP.NET encodes:

  • ASCII characters: 0-127

Code 39 and Code 39 Extension for ASP.NET data capacity:

  • Variable-length
Code 39 Data Encoding in C#, VB.NET Class Library

Installation of Code 39 Barcode Generation Component into .NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy those following C# or VB.NET example procedure onto you programs to transform stream into Code 39 image:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39;
barcode.CodeToEncode = "Code 39";
barcode.generateBarcodeToImageFile("C://barcode-code39-csharp.gif");
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39
barcode.CodeToEncode = "Code 39"
barcode.generateBarcodeToImageFile("C://barcode-code39-vbnet.gif")

Generating Code 39 with Numeric-data Only

Code 39 barcode generator for ASP.NET encodes 10 Arabic numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Replace sample code with following one:
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39;
barcode.CodeToEncode = "39";
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39;
barcode.CodeToEncode = "39"

Printing Code 39 with Alphanumeric Data Only

Code 39 barcode generator for ASP.NET allows users to encode alphanumeric data, including: 10 Arabic numbers, 26 uppercase letters (A-Z) and 7 special characters (- , $, %, Space, ., /, +). Replace sample code with following one:
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39;
barcode.CodeToEncode = "CODE-39";
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39
barcode.CodeToEncode = "CODE-39"

Creating Code 39 Extension Barcode with ASCII Characters

Code 39 barcode generator for ASP.NET also supports to create Code 39 Extension barcodes, which encodes all standard ASCII characters (0-127). Replace sample code with following one:
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39Ex;
barcode.CodeToEncode = "Code-39";
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39Ex
barcode.CodeToEncode = "Code-39"
Code 39 Data Encoding with Drag & Drop BarcodeControl into Websites
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Find barcode setting panel, choose "Symbology" to "Code39" or "Code39ex"
  5. 5.
    Then input numeric, alphanumeric or all ASCII character in "CodeToEncode" accordingly
  6. 6.
    A Code 39 or Code 39 Extension barcodes with different characters occurs
Code 39 Data Encoding in MS Internet Information Service (IIS) with URL
  1. 1.
    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.
    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=4&code-to-encode=0123456789"
  5. 5.
    A Code 39 barcode with numeric data will be displayed on the web page
Note: In IIS, Symbology.Code39 is 4 and Symbology.Code39 is 5. Users may write "symbology=4&code-to-encode=xxx" or "symbology=5&code-to-encode=xxx" accordingly to change encoded data.