четвъртък, 16 януари 2014 г.

QR Code MVC

In this blog entry, we look into the ShieldUI QR Code for MVC. The QR Code component allows encoding of alphanumeric data into a two-dimensional QR Code. 

Since the ShieldUI Barcode suite for MVC is a wrapper of javascript QR component you need to include the references to the CSS and JavaScript resources in the HEAD section of your webpage:
1
2
3
4
5
<head >
<link rel="stylesheet" type="text/css" href="css/shieldui-all.min.css" />
<script src="js/jquery-1.9.1.min.js" type="text/javascript">//</script>
<script src="js/shieldui-all.min.js" type="text/javascript">//</script>
</head>
ShieldUI QR code for ASP.NET MVC follows the MVC helper pattern by providing a set of chainable methods that configure the widgets. The C# helpers API is a 1:1 reflection of the JavaScript widgets configuration, so you only have to get familiar with a single set of configuration options:
1
2
3
4
5
6
7
8
9
//JavaScript QR demo
$("#documentation").shieldQRcode({
    mode: "byte",
    size: 150,
    value: "ShieldUI QR Code",
    style: {
        color: "#4EA6DD"
    }
});
1
2
3
4
5
6
7
8
//ASP.NET MVC QR demo
 @(Html.ShieldQRcode()
    .Name("documentation")
    .HtmlAttribute("class", "qrcode")
    .Mode(Shield.Mvc.UI.QRcode.EncodingMode.Byte)
    .Size(150)
    .Value("ShieldUI QR Code")
    .Style(style => style.Color("#4EA6DD")))
To see the configuration options in action, please refer these online demos.

Няма коментари:

Публикуване на коментар