Our Customers
Contact Us Email: support@barcodelib.com
Home > ASP.NET Barcode > ASP.NET Barcode Generation Guide > C# QR Code Generation for ASP.NET Web Application
Download Barcode for ASP.NET Trial

ASP.NET QR Code Barcode Generation in C#

How to Use C# Code to Generate QR Code Barcode for ASP.NET Web Applications
  • Easy to add Barcode for ASP.NET dll to Visual Studio .NET Framework C# project
  • Simple to generate QR Code barcode images in ASP.NET web using C# class library
  • Quick to create QR Code barcode on a web page by dragging ASP.NET Barcode DLL
  • Able to control QR Code barcode image properties through ASP.NET Barcode Controller
  • Able to use C# code to set QR Code barcode image data mode, ECL, version, color & size
  • All encoded ASP.NET QR Code barcode images are compatible with QR Code industrial specifications
ASP.NET C# QR Code Barcode Generation - Requirement
  • BarcodeLib.Barcode.ASP.NET.dll
  • Microsoft .NET Framework 2.0 or greater
  • Visual Studio .NET 2005 or greater
ASP.NET Web Controller - C# QR Code Generation
Unzip Barcode for ASP.NET trial package and you will find BarcodeLib.Barcode.ASP.NET.dll. Then do as follows:
  1. Add it to your ASP.NET C# project Toolbox.
    Right click Toolbox, select Choose Items..., switch to .NET Framework Components tab, and locate BarcodeLib.Barcode.ASP.NET.dll. Then, you'll find four components, including QRCodeASPNET.
  2. Under barcode folder of the trial package, copy files "qrcode.aspx", "qrcode.aspx.cs" to your created ASP.NET project folder where the barcode images will be generated.
  3. Drag QRCodeASPNET to aspx page and then run the project to see the generated QR Code image. And this QR Code barcode properties are all in default values.
  4. If you want to customize the QR Code image properties, you may directly set in the Properties window or using the C# code like below.
     this.QRCodeASPNET1.Data = "www.barcodelib.com";
     this.QRCodeASPNET1.ModuleSize = 3;
     this.QRCodeASPNET1.LeftMargin = 12;
     this.QRCodeASPNET1.RightMargin = 12;
     this.QRCodeASPNET1.TopMargin = 12;
     this.QRCodeASPNET1.BottomMargin = 12;
     this.QRCodeASPNET1.ECL = BarcodeLib.Barcode.QRCodeErrorCorrectionLevel.H;
ASP.NET Class - C# QR Code Barcode Image Generation
  1. Add BarcodeLib.Barcode.ASP.NET.dll to your ASP.NET C# project Reference.
    In Solution Explorer window, right click on your project, select Add Reference..., switch to Browse tab and find BarcodeLib.Barcode.ASP.NET.dll.
  2. Then, please use the following Visual C# sample code to generate QR Code for your ASP.NET application.
     QRCode qrcode = new QRCode();
     qrcode.Data = "www.barcodelib.com";
     qrcode.ModuleSize = 4;
     qrcode.ECL = QRCodeErrorCorrectionLevel.L;
     qrcode.ImageHeight = 118;
     qrcode.ImageWidth = 118;

     // Save QR Code barcode image into your system
     qrcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif;
     qrcode.drawBarcode("C:/sample-qrcode.gif");
BarcodeLib.com also provides online guide for VB.NET QR Code Generation for ASP.NET.
Barcode for ASP.NET - Support Linear & 2D Barcodes
Besides QR Code, Barcode for ASP.NET also supports the following barcode types:
  • ASP.NET 1D Barcodes: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, Code 128, EAN-8, EAN-13, GS1-128, Interleaved 2 of 5, ITF-14, MSI Plessey, Intelligent Mail, PLANET, POSTNET, RM4SCC, UPC-A, UPC-E.
  • ASP.NET 2D Barcodes: Data Matrix and PDF-417. Please click "Go" to see each barcode generation details.
ASP.NET 1D Barcodes:
ASP.NET 2D Barcodes: