Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
    • Angular
    • C
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
  • Register
  • Login
  1. Home
  2. Blogpost

QR Code Generator

Date- Sep 05,2021

10119

Free Download Pay & Download
QR Code Generator QR Code

QR Code Generator

So , sometimes we all need to show some data in Barcode or QR Code format in our website . For that purpose we will use Jquery QR Code Generator library . This is a free jquery library that takes data as input and created a QR Code representing the same data which can be scanned from mobile devices.So for that purpose first of all we need to add these libraries , as shown in the image. We will provide these libraries along with complete source code for you to download.

So, after adding these libraries in your project , we will add them on our webpage.

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/Content/QRCode/jquery.qrcode.min.js"></script>
<script src="/Content/QRCode/qrcode.js"></script>

So , after adding the scripts we have to add the data which you want to convert in the QR Code in specific format, So the sample data should be in this format

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/Content/QRCode/jquery.qrcode.min.js"></script>
<script src="/Content/QRCode/qrcode.js"></script>
<div class="jumbotron">
    <h1>QR Code Generator</h1>

</div>

<div class="row">
    <div class="QrCode"></div>
</div>
@*<div id="textarea" style="display:none">@Html.Raw(template)</div>*@
@section scripts{
    <script>
        $(document).ready(function () {
            var data = "BEGIN:VCARD\nVERSION:3.0\nFN:CodeFlow\nTITLE:QR Code\nTEL;TYPE=HOME,VOICE:8877665545\nEMAIL;WORK;INTERNET:abc@gmail.com\nEND:VCARD";
            renderQR(data);
        })

        function renderQR(data) {
            $('.QrCode').html('');
            $('.QrCode').qrcode({
                width: 300,
                height: 300,
                text: data
            });
        }
    </script>
}


So , in this first we have created the sample data and added that in the textarea and while generating QR code we are picking the data from textarea.This script is used for QR Code Generator.

<script>
     $(document).ready(function () {
            var data = "BEGIN:VCARD\nVERSION:3.0\nFN:CodeFlow\nTITLE:QR Code\nTEL;TYPE=HOME,VOICE:8877665545\nEMAIL;WORK;INTERNET:abc@gmail.com\nEND:VCARD";
            renderQR(data);
        })

        function renderQR(data) {
            $('.QrCode').html('');
            $('.QrCode').qrcode({
                width: 300,
                height: 300,
                text: data
            });
        }
</script>

So , this we generate a QR code which you can see in the below screenshot

And when you scan this code in your mobile device you can see the actual data which you have passed while generating QR Code.

So, this is how we can generate QR Code or Barcode in Asp.Net Mvc. If you get any issue with this you can comment on the video and let us know. You can see the attachment button above to download the source code.

S
Shubham Batra
Programming author at Code2Night โ€” sharing tutorials on ASP.NET, C#, and more.
View all posts โ†’

Related Articles

Mastering ASP.NET Core MVC: A Comprehensive Tutorial for Beginners
Mar 16, 2026
ASP.NET CORE CRUD Operations With Entity Framework Core In .NET CORE 8.0
Nov 21, 2023
How to Convert Text to Speech in Asp.Net
Nov 06, 2023
How to export table data in pdf using itextsharp in asp.net mvc
Sep 16, 2023

Comments

Tags

AspNet
C#
programming
AspNet MVC
c programming
AspNet Core
C
software development
tutorial
MVC
memory management
Paypal
coding
coding best practices
data structures
programming tutorial
tutorials
object oriented programming
Slick Slider
StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blogs
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
By Language
  • Angular
  • C
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ยท  Terms
Translate Page