title: How to Display Image in the Image Control using FileUpload?
body: <p>I just call this function on a button click.
   I also want to know in which event of FileUpload I can call this function.</p>
  
  <pre><code> Function upload() As Boolean
          Dim img As FileUpload = CType(imgUpload, FileUpload)
          imgByte = Nothing
          If img.HasFile AndAlso Not img.PostedFile Is Nothing Then
              Dim File As HttpPostedFile = imgUpload.PostedFile
              imgByte = New Byte(File.ContentLength - 1) {}
              File.InputStream.Read(imgByte, 0, File.ContentLength)
          End If
          Dim strImagePath As String = imgUpload.FileName
          imgUpload.PostedFile.SaveAs(Server.MapPath("..\Temporary\" + strImagePath))
          imgLogo.ImageUrl = Server.MapPath("..\Temporary\" + strImagePath)
          imgLogo.DataBind()
      End Function
  </code></pre>
  
  <hr>
  
  <p>Even after setting the url, image is not showing.I am sure that image file is created on the server and the path specified is right.</p>