ASP.NET: Generate QR code image using Google Chart API - ASPMANTRA | Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server AND WCF snippets and tutorial

ASP.NET: Generate QR code image using Google Chart API

In this article I am going to explain how to generate QR code image using Google Chart API in

QR code image will be generating using Google chart API with a url get request.

HTML Markup:
<fieldset style="width:30%">
        <legend>Generate QR Code using Google API</legend>
        <tr><td>Enter URL OR Text:</td><td><asp:TextBox ID="txturl" runat="server"></asp:TextBox></td></tr>
        <tr><td colspan="2"><asp:Image runat="server" ID="QRImage"/></td></tr>

        <tr><td></td><td><asp:Button ID="btnsubmit" runat="server" Text="Generate QR Code" onclick="btnsubmit_Click" /></td></tr>

Generate QR code
On Button click write the below given code.
C# code:
protected void btnsubmit_Click(object sender, EventArgs e)
            var url = "" + txturl.Text + "";
            QRImage.ImageUrl = url;
        catch(Exception ex)
    } Code:
Protected Sub btnsubmit_Click(sender As Object, e As System.EventArgs) Handles btnsubmit.Click
            Dim url = "" + txturl.Text + ""
            QRImage.ImageUrl = url
        Catch ex As Exception
        End Try
    End Sub

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.