C#.NET4 Construction Web page upload image before client preview picture cannot be displayed

Source: Internet
Author: User

Made long time, completely according to the teaching material set Javascrip script, but is not show, later found that the original client to the site to be trusted to display.

So record it and check it later.

<script type= "Text/javascript" >
function Showphoto () {
Alert (document.getElementById ("FileUpload1"). Value);
Assigns the full path + file name of the selected picture to the preview control with "File:///r:\test.jpg" image1.src
Note: To set the client to trust this site, you can perform the script preview picture.
document.getElementById ("Image1"). src = document.getElementById ("FileUpload1"). Value;
}
</script>

<asp:fileupload id= "FileUpload1" runat= "Server" height= "19px" width= "222px" onchange= "Javascript:showphoto ();" />
<asp:image id= "Image1" runat= "Server" height= "93px" width= "103px" alternatetext= "no Picture selected"/>

C#.NET4 Construction Web page upload image before client preview picture cannot be displayed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.