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

How to Generate QR Code in ASP.NET Web Server?

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

ASP.NET QR Code Creator is one of the barcode generation functions in pqScan Barcode Creator for ASP.NET. In this tutorial, you can find three ways to generate QR Code in ASP.NET web applications.

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

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

  1. Unzip the downloaded QR Code barcode generator package to your web project's bin folder.
  2. Add ASP.NET Barcode Creator Web Control to Visual Studio Toolbox.
  3. Copy "BarcodeWebHandler.ashx" file to the direction where the web page would render QR Code images.
  4. Drag and drop BarcodeWebControl to your ASPX web forms.
  5. Run the web application to view the QR Code barcode created.
  6. To customize the QR Code settings, you can make changes in the "properties" pane or in the run-time code. And there is another way to do this: using JavaScript to change the ASP.NET QR Code Creator web image control's src property.

Making and painting QR Code on web page or html page in IIS

  1. Publish your ASP.NET web site to IIS.
  2. Copy bin folder from downloaded barcode generator package to your IIS.
  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=QRCode&Data=123456789&Width=300&Height=300&UseUTF8=False&QRCodeECL=L"/> to the page.
  5. Viewing html page on web browser, you will see the barcode generated 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 QR Code image will not appear.

Encoding and rendering QR Code use ASP.NET Barcode Creator API in web form class

Here we provide C# sample code to introduce you how to generate QR Code in ASP.NET web applications. The only thing you need is to copy the C# code below to your web page.

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

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

            qrcode.Data = "qrcode-demo-code";
            qrcode.BarType = BarCodeType.QRCode;
            qrcode.QRCodeECL = ErrorCorrectionLevelMode.L;
            qrcode.Width = 300;
            qrcode.Height = 300;


generate qrcode in asp.net

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