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#

黄舟
黄舟Original
2017-01-19 10:55:021648browse

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" />

JS:

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


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)!


Statement:
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