解决方法
尝试这个
<asp:FileUpload ID="FileUpload01" ClientIDMode="Static" onchange="this.form.submit()" runat="server"/>
在page_load事件后面的代码中
if (IsPostBack && FileUpload01.PostedFile != null) { if (FileUpload01.PostedFile.FileName.Length > 0) { FileUpload01.SaveAs(Server.MapPath("~/Images/") + FileUpload01.PostedFile.FileName); imguser.ImageUrl = "~/Images/" + FileUpload01.PostedFile.FileName; } }