Home >Backend Development >C#.Net Tutorial >Specific implementation of the preview effect after selection of FileUpload in C#
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:
#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)!