title: Object reference not set to an instance of an object
body: <p>I am getting an error with an aspx Upload Control &amp; Drop Down List on a single aspx page.</p>
  
  <p>Here is the error...</p>
  
  <pre><code>Object reference not set to an instance of an object.
  </code></pre>
  
  <p>Here is my code for the on_submit...</p>
  
  <pre><code>protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
      {
          if (e.IsValid)
          {
              string uploadDirectory = Server.MapPath("~/files/");
              //string uploadDirectory = "//DOCSD9F1/TECHDOCS/";
  
              string uploadFolder = DropDownList1.SelectedItem.Text;
  
              string fileName = e.UploadedFile.FileName;
  
              string path = (uploadDirectory + uploadFolder + fileName);
  
              e.UploadedFile.SaveAs(path);
              e.CallbackData = fileName;
          }
      }`
  </code></pre>
  
  <p>here is my code for creating the drop down list...</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              DirectoryInfo di = new DirectoryInfo("D:/SMGUpload/SMGUpload/files");
  
              DropDownList1.DataSource = di.GetDirectories();
  
              DropDownList1.DataBind();
  
              foreach (DirectoryInfo i in di.GetDirectories())
              {
                  DropDownList1.DataTextField = i.FullName;
                  DropDownList1.DataValueField = i.FullName;
              }
          }
      }`
  </code></pre>