title: updating text box after ajax file upload
body: <p>I am using <a href="http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AsyncFileUpload/AsyncFileUpload.aspx" rel="nofollow">this</a> Ajax file upload in my project and it's working fine, my only problem is how can I save the path of the photo the I just uploaded? 
  basically I tried to copy the path to a TextBox control after a successful upload and surround that text box with an updatepanel and update that panel manually after calling the Ajax's SaveAs method, but it doesn't seem to work.</p>
  
  <p>this is the code for the the uploadedComplete event:</p>
  
  <pre><code>protected void AsyncFileUpload1_UploadedComplete (object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
      {
          System.Threading.Thread.Sleep(3000);
          if (AsyncFileUpload1.HasFile)
          {
              var relativeFolder = DateTime.Now.Year.ToString(CultureInfo.InvariantCulture) + Path.DirectorySeparatorChar + DateTime.Now.Month +
                               Path.DirectorySeparatorChar;
              relativeFolder = relativeFolder.Replace('\\', '/');
              var folder = Utils.RelativeWebRoot + "PostPhotos/" + relativeFolder;
              var fileName = Path.GetFileName(e.FileName);
  
              AsyncFileUpload1.SaveAs(Server.MapPath(folder + fileName));
  
              txtPostPhoto.Text = folder + fileName;
              PostImage.ImageUrl = txtPostPhoto.Text;
  
              PostPhotoUpdatePanel.Update();
          }
      }
  </code></pre>
  
  <p>txtPostPhoto is my text box.</p>
  
  <p>PostImage is where I am trying to display the image preview.</p>
  
  <p>is there another way of doing this? </p>