Hello Friends ,i want to upload an image the moment i upload the file i want to view in my image control..I tried a lot friends i cannot achieve it please help me Friends to achieve it...
This is my aspx code------
<td style="text-align: left">
<div>
<asp:AsyncFileUpload ID="fileUpload1" CompleteBackColor="White" Width="350px" runat="server" UploaderStyle="Modern" UploadingBackColor="#CCFFFF" ThrobberID="imgLoad" OnUploadedComplete="fileUploadComplete" />
<asp:Image ID="imgLoad" runat="server" ImageUrl="loading.gif" />
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Image ID="Image1" runat="server" Height="250" Width="250" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
this is my cs code---
protected void fileUploadComplete(object sender, AsyncFileUploadEventArgs e) {
Thread.Sleep(1000); string filename = System.IO.Path.GetFileName(fileUpload1.FileName);
completeurl=@"Files/" + filename;
fileUpload1.SaveAs(Server.MapPath(completeurl));
Image1.ImageUrl = "~\\Files\\200.jpg";
}
Please help me friends---