QR Code Image Sample - pqScan.com
ASP.NET Barcode Creator Control Encoding Barcode Image in ASP.NET Web forms Online Demo Download Trial Purchase Now
.NET Winforms

How to Generate Barcode in ASP.NET Web Server?

back to home  >  .NET Barcode Generator SDK  >  Generate Barcodes in ASP.NET

The pqScan Barcode Creator is useful toolkit to help developers to generate perfect quality barcode image in quick speed. This article is a tutorial to introduce you how to encode barcodes in ASP.NET server application with two main ways: in ASP.NET web applicaton and in ASP.NET web froms class.

All the barcodes we supplied can be print in web pages.

1D: EAN 8, EAN 13, UPC-A, Code-128, Code-39.

2D: QR Code, PDF-417, Data Matrix, Aztec Code.

Generate Barcodes us Barcode Web Control in ASP.NET Web Application

In this mode, users can encode and print barcode on web page by two ways: in Visual Studio ASP.NET Web Site or in IIS web application. Before starting, both of the two way need download pqScan Barcode Creator SDK first.

Encoding barcode use ASP.NET Barcode Creator Web Control in Visual Studio

To use the pqScan Barcode Creator WebForms control, follow these steps:

  1. Unzip the downloaded Trial package to development computer.
  2. Add Barcode Creator Webforms Control to the Visual studio Toolbox.
    • In the ASP.NET Web application, open a Web Form in design mode.
    • Select View - Toolbox to display the Toolbox
    • Right click on the General pane and select Choose Items...
    • In the dialog box Choose Toolbox Items, ensure the .NET Framework Components tab is displayed.
    • Push the Browse button and navigate to the "PQScan.BarcodeCreator.dll" file.
    • Ensure the checkbox of pqScan Barcode Creator Webforms Control "BarcodeWebControl" is checked.
  3. With a project's web form open in design mode, drag the Barcode Creator control item from toolbox onto the web form.
  4. Copy "BarcodeWebHandler.ashx" file in to your ASP.NET web site.

Encoding barcode use ASP.NET Barcode Creator Web Control in IIS

  1. Unzip the downloaded Trial package to development computer.
  2. Publish you APS.NET web site to your IIS.
  3. Copy bin folder to your IIS.
  4. Copy "BarcodeWebHandler.ashx" file to your IIS root path.
  5. Create an empty html, and add an image with code <img src="http://localhost:port/BarcodeWebHandler.ashx?BarType=Code128&Data=123456789&Width=300&Height=100"/>
  6. Viewing html page on web browser, you will see the barcode made on the page.

Note: When you use pqScan Barcode Creator Web Control to generate barcodes, please ensure the "BarcodeWebHandler.ashx" file is copied to the folder where the web pages are generating barcodes in both ways above.

Note: Creating a barcode image both in Visual Studio web site and in IIS, the src property of <img> tag can be changed by javascript to customize barcode image, and there is no need to refresh whole web page.

Encode barcode use ASP.NET Barcode Creator component API

To make barcode image using pqScan Barcode Creator in ASP.NET Web form class, follow these steps:

  1. Download and unzip the Trial package to development computer.
  2. Add "PQScan.BarcodeCreator.dll" to your ASP.NET Web form project reference.(The DLL will be copied automatically to the project bin folder).
  3. Using following C# code to your ASP.NET Web from class:
using System;
using System.Web;
using System.Web.UI;
using PQScan.BarcodeCreator;

namespace BarcodeGeneratorInWeb
    public partial class WebForm1 : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            Barcode barcode = new Barcode();

            barcode.Data = "www.pqscan.com";
            barcode.BarType = BarCodeType.Code128;
            barcode.Width = 200;
            barcode.Height = 100;


.NET Barcode Creator QR Code Creator in ASP.NET Data Matrix Creator in ASP.NET PDF 417 Creator in ASP.NET Aztec Creator in ASP.NET EAN 13 Creator in ASP.NET EAN 8 Creator in ASP.NET UPC A Creator in ASP.NET Code 128 Creator in ASP.NET Code 39 Creator in ASP.NET