0

enter image description here

I need to display uploaded image in the div on the top after using FileUpload without any button, so I tried this code ;

HTML

<div class="photo"><asp:Image ID="maPhoto" runat="server" length="100px" Width="100px"/></div>

<td><asp:FileUpload  ID="FileUpload1" runat="server" onchange="onChangeUpload"/></td>

c#

protected void onChangeUpload(object sender, EventArgs e)
{
   this.maPhoto.ImageUrl = this.Page.MapPath(FileUpload1.FileName);
}
AlecDev
  • 47
  • 3

0 Answers0