Introduction: Image preview before upload

In this post, we will learn about how to Display Image preview before upload in or HTML and Jquery in using html and javascript.


In my previous posts I have explained various topics like Get site visitor count in
Convert generic list to datatable in Asp.Net C#.Net, Abstract Class in C# with Example,
Routing in Asp.Net MVC with Example
,Use of Global.asax in
Now in this post, I will explain about Display Image preview before upload in or HTML and Jquery with example.

<html xmlns="">
<head runat="server">
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        function showImagePreview(input) {
            if (input.files && input.files[0]) {
                var filerdr = new FileReader();
                filerdr.onload = function (e) {
    <form id="form1" runat="server">
            <h1>Display Image preview before upload</h1>
                <input type="file" onchange="showImagePreview(this)" />
                <br />
                <br />
                <img id="imgPreview" alt="Preview image" width="400" />
Image preview before upload

Image Preview

I hope you got an idea about how to Display Image preview before actually upload in or HTML and Jquery.I would like to have feedback from my blog readers.
Your valuable feedback, question, or comments about this article are always welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *