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

How to Generate Data Matrix in ASP.NET Web Server?

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

ASP.NET Data Matrix Creator is one of the barcode generation functions in pqScan Barcode Creator for ASP.NET. There are three ways to show you creating Data Matrix in ASP.NET applications. The first two introduce you to generate Data Matrix using Barcode Web Control, the last one introduces you to encode Data Matrix in library API.

Generating and painting Data Matrix on web page or html page in IIS

  1. Publish your ASP.NET web site to IIS.
  2. Copy "PQScan.BarcodeCreator.dll" file from downloaded barcode generator package to your IIS bin folder.
  3. Copy "BarcodeWebHandler.ashx" file from downloaded barcode generator package to your IIS.
  4. Create an empty html, and add the image code <img src="http://localhost:port/BarcodeWebHandler.ashx?BarType=DataMatrix&Data=123456789&Width=300&Height=300&DataMatrixShape=Auto"/> to the page.
  5. Viewing html page on web browser, you will see the Data Matrix barcode created on the page.

Note: Please make sure the "BarcodeWebHandler.ashx" file is copied to the folder where the web pages are generating barcodes, otherwise the Data Matrix image will not appear.

Making Data Matrix and printing it on web pages using ASP.NET Barcode Creator Web Control in Visual Studio

To generate Data Matrix barcode from pqScan Barcode Creator WebForms control, you need do some work like this:

  1. Unzip the downloaded Data Matrix barcode generator package, copy the "PQScan.BarcodeCreator.dll" to your web application's bin folder.
  2. Add ASP.NET Barcode Creator Web Control to Visual Studio Toolbox.
  3. Drag and drop BarcodeWebControl to your ASPX web forms.
  4. Copy "BarcodeWebHandler.ashx" file to the direction where the web page would draw Data Matrix images.
  5. Run the web application to view the Data Matrix image generated.
  6. To customize the Data Matrix image, you can make changes in the "properties" pane or in the run-time code. Additional, changing Data Matrix web image control's src property by java script is also support.

Encoding and creating Data Matrix use ASP.NET Barcode Creator API in web form class

In this example, we will give a guide to introduce you how to generate Data Matrix using C# in ASP.NET project.

using System;
using System.Web;
using System.Web.UI;
using PQScan.BarcodeCreator;

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

            datamatrix.Data = "pqScan123456789";
            datamatrix.BarType = BarCodeType.DataMatrix;
            datamatrix.Width = 300;
            datamatrix.Height = 300;
            datamatrix.DataMatrixShape = SymbolShapeMode.Square;

            datamatrix.CreateBarcode("datamatrix-webforms.bmp");
        }
    }
}

generate datamatrix in asp.net

.NET Barcode Creator QR Code 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