Topic:   How do I clear an image in asp.net image control ?
Oct 17, 2020 04:16 1 Replies 29 Views FRAUSKY

1

<asp:Image ID="Image3" runat="server" Width="260px" Height="400px" />

a javacript that displays image when uploaded:

1

2

3

4

5

6

7

8

9

10

11

12

13

<script type="text/javascript">

    function ImagePreview(input) {

        if (input.files && input.files[0]) {

            var reader = new FileReader();

            reader.onload = function (e) {

                $('#<%=Image3.ClientID%>').prop('src', e.target.result)

                    .width(260)

                    .height(400);

            };

            reader.readAsDataURL(input.files[0]);

        }

    }

</script>

Prev Next
Topic Replies (1)
  1. 1
    idnkx user

    PARTH

    Set the source of the image to null as shown below -
    Image1.Source = null

Leave a Reply
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let's Connect