Login Register
Code2night
  • Home
  • Blog Archive
  • Learn
    • Tutorials
    • Videos
  • Interview Q&A
  • Languages
    • Angular
    • C
    • c#
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • Security
    • 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
    • SEO Analyzer
    • Background Remover
  1. Home
  2. Blog
  3. QR Code Generator: A Complete Step-by-Step Guide

QR Code Generator: A Complete Step-by-Step Guide

Date- Sep 05,2021

10158

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

How to Download Files as Zip in ASP.NET: Step-by-Step
May 21, 2023
How to Export View as PDF in ASP.NET Core: Complete Guide
Jul 05, 2022
Complete Guide to Excel Export in ASP.NET MVC using XlWorkbook
Jun 11, 2022
CRUD Operations with Entity Framework in ASP.NET MVC
Sep 20, 2020
Previous in ASP.NET MVC
Step-by-Step: Integrating Google Places API in ASP.NET MVC
Next in ASP.NET MVC
Step-by-Step: Integrating Google Sign-In in ASP.NET MVC

Comments

Contents

๐ŸŽฏ

Interview Prep

Ace your ASP.NET MVC interview with curated Q&As for all levels.

View ASP.NET MVC Interview Q&As

More in ASP.NET MVC

  • Implement Stripe Payment Gateway in ASP.NET: Complete Guide 58621 views
  • Integrate jQuery Full Calendar with ASP.NET MVC: Step-by-Ste… 39539 views
  • Retrieve Appointments from Microsoft Outlook Using ASP.NET M… 27485 views
  • How to Implement and Validate JWT Token Authentication in AS… 25172 views
  • Integrate PayUMoney with ASP.NET MVC: Step-by-Step Guide 23121 views
View all ASP.NET MVC posts โ†’

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
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
  • Blog Archive
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
  • SEO Analyzer
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
  • SEO Analyzer
By Language
  • Angular
  • C
  • c#
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • Security
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ยท  Terms
Translate Page
We use cookies to improve your experience and analyze site traffic. By clicking Accept, you consent to our use of cookies. Privacy Policy
Accessibility
Text size
High contrast
Grayscale
Dyslexia font
Highlight links
Pause animations
Large cursor