Home > Backend Development > C#.Net Tutorial > Specific implementation of the preview effect after selection of FileUpload in C#

Specific implementation of the preview effect after selection of FileUpload in C#

黄舟
Release: 2017-01-19 10:55:02
Original
1652 people have browsed it

Preview effect after selecting FileUpload in C

#Implementation method:

HTML:

<asp:FileUpload ID="fupTmpPic" runat="server" onchange="onFileChange(this);" />   
<asp:Image ID="imgDimensionalPic" runat="server" />
Copy after login

JS:

<script type="text/javascript">   
function onFileChange(sender) {   
document.getElementById("imgDimensionalPic").src = window.URL.createObjectURL(sender.files[0]);   
}
Copy after login


Example:

Specific implementation of the preview effect after selection of FileUpload in C#

#The above is the specific implementation of the preview effect after selecting FileUpload in C#. For more related content, please pay attention to PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template