FileUpload da Seçilen Resmi Görüntüleme

<script src="https://code.jquery.com/jquery-1.11.2.js" type="text/javascript">

</script>
<script type="text/javascript">
    function resmiGoster(input) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            reader.onload = function (e) {
                $('#<%=Image1.ClientID%>').prop('src', e.target.result)
                .width(120)
                .height(120);

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

        }
</script>
<asp:Image ID="Image1" ImageUrl="~/img/default.png" runat="server" Width="120px" />
<asp:FileUpload ID="FileUpload1" runat="server" onchange="resmiGoster(this);"   />

Hiç yorum yok:

Yorum Gönder