title: How can read the value of text box from Ajaxfileupolad control
body: <p>I am assigning the value to the variable from the text box on the page during the pageupload event of AjaxFileUpload1.The problem is that, I am not getting the value from the text box to my variable even though no error throws.My variables are</p>
  
  <pre><code>    string scn = txtSCN.Text;
      string line1 = txtLineitem.Text;
      string aging1 = txtAging.Text;  
  </code></pre>
  
  <p>Any idea why <code>AjaxFileUpload1_UploadComplete</code> is not able to read text box value</p>
  
  <p>My cs Code is:</p>
  
  <pre><code>protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
  {
      string c = System.IO.Path.GetFileName(e.FileName);
      string dpath = "~/Profile/Images/";
      string scn = txtSCN.Text;
      string line1 = txtLineitem.Text;
      string aging1 = txtAging.Text;             
      AjaxFileUpload1.SaveAs(MapPath(Path.Combine(dpath,c)));
      dpath = dpath + c;
      string str1 = ConfigurationManager.ConnectionStrings["ProTracConnGMCH"].ConnectionString;
      SqlConnection cn = new SqlConnection(str1);
      cn.Open();
      string sql = "Update tbNoquoteFollowupupdate set MailreceivedURL = '" + dpath + "', chkMailreceived = 1 , Buyername =  '" + buyername + "'  where scn = '" + scn + "' AND lineItem = '" + line1 + "' and Aging ='" + aging1 + "' ";
      SqlCommand cmd = new SqlCommand(sql, cn);
      int i = cmd.ExecuteNonQuery();
  
      if (i &gt; 0)
      {
          // AjaxFileUpload1.SaveAs(Path.Combine(dpath, e.FileName));
          //AjaxFileUpload1.SaveAs(MapPath(dpath));
      }
      cn.Close();
      BindGridviewData1();
      cn.Open();
      string cmd2 = "Insert Into tbMulitmailsreived (scn, lineItem,followupdate, Aging,MailreceivedURL) Values ('" + scn + "', '" + line1 + "','" + DateTime.Now + "','" + aging1 + "','" + dpath + "')";
      SqlCommand sqlCommand2 = new SqlCommand(cmd2, cn);
      sqlCommand2.ExecuteNonQuery();
      cn.Close();
  }
  </code></pre>