The Informatix QR-Code Generator 

[ Log In ]
 
 

QRCodeControl Web-Control for ASP.NET Developers

The QR-Code image generated by this website is a standard Windows ASP.NET WebControl component written in C#. This QRCodeControl can be used as part of your ASP.NET web application. Just drop the component on to your web form, set the control's properties at design-time using the control's task button, or in the ASPX markup. Programmatically set the control's properties in your code at run-time using VB or C# code behind.

The QRCodeControl features

  • Compatible with Visual Studio 2005, 2008, 2010 and 2012.
  • Works with the .NET runtime versions 2.0, 3.0, 3.5, 4.0 and 4.5.
  • Development version with design-time support and help, and lean version without for deployment on production servers.
  • The control's properties can be set and get statically at design-time and dynamically at runtime.
  • Comprehensive developer's help file containing tutorial and examples.
  • Local QR-Code generation, no live Internet connection is required.

The QRCodeControl at Design-Time.

In Developer Studio drag and drop the QRCodeControl on to the Default.aspx form if viewed in design mode. Using the QRCodeControl's task button, encode the text in the required format using the "Format Encoded Text Editor" dialog box. Similarly, adjust the look of the QR-Code image using the "Format Image Editor" dialog box.

The something like the following markup in the Default.aspx file will be generated if viewed in source mode.

        <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
            CodeBehind="Default.aspx.cs" Inherits="QRCodeControlTest._Default" %>

        <%@ Register assembly="QRCodeLib" namespace="Informatix.QRCodeLib" tagprefix="cc1" %>

        <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
        </asp:Content>
        <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
            <h2>
                Welcome to THE QR CODE CONTROL!
            </h2>
            <cc1:QRCodeControl ID="QRCodeControl1" runat="server" Text="Hello World!">
                <Databit Color="#FF8000" Coloring="RandomShade" Shape="Circle" />
                <Positioner BottomLeftInnerColor="Orange" TopLeftInnerColor="Orange" 
                    TopRightInnerColor="Orange" BottomLeftOuterColor="Brown" 
                    TopLeftOuterColor="Brown" TopRightOuterColor="Brown" />
            </cc1:QRCodeControl>
        </asp:Content>
    

The QRCodeControl at Run-Time.

All of the QRCodeControl properties can be get or set at run-time. The following code snippet shows how the QR-Code databits can be changed, the encoded text changed to a contact, and finally the QR-Code can be checked to see if it is likely to be successfully read by a typical QR-Code reader.

        using System;
        using System.Collections.Generic;
        using System.Drawing;
        using System.Linq;
        using System.Web;
        using System.Web.UI;
        using System.Web.UI.WebControls;
        using Informatix.QRCodeLib;

        namespace QRCodeControlTest
        {
            public partial class _Default : System.Web.UI.Page
            {
                protected void Page_Load(object sender, EventArgs e)
                {
                    // Change the databit colour to red.
                    this.QRCodeControl1.Databit.Color = Color.Red;

                    // Change the databit colouring to a fixed colour.
                    this.QRCodeControl1.Databit.Coloring = QRCodeControl.DatabitGroup.ColoringType.FixedColor;

                    // Change databit shape to a heart.
                    this.QRCodeControl1.Databit.Shape = QRCodeControl.DatabitGroup.ShapeType.Heart;

                    // Change the encoded text to a PayPal buy-now format.
                    this.QRCodeControl1.Text = TextFormatter.Paypal.Encode(
                        "buy@mysite.com", "Widget", "123456", 10.99M, TextFormatter.Paypal.Currency.GBP);

                    // Display an "Invalid" message over the QR-Code if it cannot be read.
                    if (!this.QRCodeControl1.IsValid)
                        this.QRCodeControl1.OverlayText.Text = "Invalid";
                }
            }
        }
    

Acquiring the QRCodeControl

If you have any questions, comments or would like to get a copy of this control for use on your web application, please enquire at Informatix Ltd.