前台代码:
<script type="text/javascript">
function Img(url){
var pic = document.getElementById("Image1");
pic.src = url;
}
</script>
<img alt="" src="" id="Image1" />
<br />
<asp:FileUpload ID="FileUpload1" runat="server" />
<br />
后台:
FileUpload1.Attributes.Add("onchange", "Img(this.value);"); |