3
Reply

Display Image from Folder on Server

toanhoi bui

toanhoi bui

Sep 14 2011 1:12 AM
3.2k
Hello everbody, I uploaded a image to server and want to show image on Image control by ASP. My code
  String filename = FileUpload1.PostedFile.FileName;
  string strFilename = Server.MapPath("Sample") + "//" + filename;
  FileUpload1.PostedFile.SaveAs(strFilename);
  //Show Image
  Image2.ImageUrl=strFilename ;
But it does not run. Can you help me to show a image on server.Thanks


Answers (3)