QRCode Overview

The Telerik UI QRCode HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI QRCode widget.

QR codes take a piece of information from a transitory media, place it into the cell phone, and enable the cell phone to quickly read these generated images. All graphics are rendered on the client by using Canvas or SVG.

The QRCode generates Canvas and Scalable Vector Graphics (SVG) images that represent Quick Response (QR) codes.

Telerik UI for ASP.NET MVC Ninja image
New to Telerik UI for ASP.NET MVC?

Telerik UI for ASP.NET MVC is a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

To see the component in action, check the examples:

Initializing the QRCode

The following example demonstrates how to define the QRCode.

    @(Html.Kendo().QRCode()
      .Name("qrUrl")

Basic Configuration

To configure the QRCode, pass the configuration options as attributes, for example:

  • The name of the QRcode is mandatory—it specifies the "id" attribute of the widget.

  • The value attribute allows you to set the initial value of the widget.

  • The error correction level allows you to control the density of the QRcode image.

    Html.Kendo().QRCode()
        .Name("qrUrl")
        .Value("https://docs.telerik.com/aspnet-core/introduction")
        .ErrorCorrection(QRErrorCorrectionLevel.M)
        .Size(150)
        .Border(border => border.Color("#AA11AA").Width(2))
    )
)

Functionality and Features

The QRCode supports a set of encoding conventions.

Referencing Existing Instances

To reference an existing QRCode instance, use the jQuery.data() configuration option. Once a reference is established, use the QRCode client-side API to control its behavior.

// Place the following after the declaration of the QRCode for ASP.NET MVC.
<script>
    $(function() {
        // The Name() of the QRCode is used to get its client-side instance.
        var qrcode = $("#qrcode").data("kendoQRCode");
    });
</script>

See Also

In this article