title: System.Web.UI.WebControls.FileUpload issues with "AllowMultiple" and "PostedFiles" during Multiple FileUpload Asp.net
body: <p>So I'm trying to upload multiple files (images) in asp.net 4.0. I have done this before and just a little time ago this was working and all I did was try to debug a value and after that it started crying. 
  <p>I have tried googling (in case you wonder) but I can't find the solution to my problem.
  <p> So here's the <strong>aspx</strong> code</p>
  
  <pre><code>&lt;asp:FileUpload ID="FileUpload1" Multiple="Multiple" runat="server" /&gt;
  </code></pre>
  
  <p><p> I changed the <code>AllowMultiple="true"</code> to <code>Multiple="Multiple"</code> after knowing the former is for asp.net 4.5 and above and that's weird because it worked before.</p>
  
  <p><p> This is my <strong>.cs</strong> code.</p>
  
  <pre><code>foreach (var file in FileUpload1.PostedFiles)
                  {
                      string filename = Path.GetFileName(file.FileName);
  
                      file.SaveAs(Server.MapPath("../Pics/" + filename));
  
                      SqlCommand cmd = new SqlCommand("Insert into slider(photo) values(@ImagePath)", conn);
  
  
                      cmd.Parameters.AddWithValue("@ImagePath", filename);
  
                      conn.Open();
                      cmd.ExecuteNonQuery();
                      conn.Close();
  
  
  
              }
  </code></pre>
  
  <p>It gives a blue underline on PostedFiles and the error reads
  <p><code>"'System.Web.UI.WebControls.FileUpload' does not contain a definition for 'PostedFiles' and no extension method 'PostedFiles' accepting a first argument of type 'System.Web.UI.WebControls.FileUpload' could be found (are you missing a using directive or an assembly reference?)"</code>
  <p> And another error also appears:
  <p> <code>"'System.Web.UI.WebControls.FileUpload' does not contain a definition for 'AllowMultiple' and no extension method 'AllowMultiple' accepting a first argument of type 'System.Web.UI.WebControls.FileUpload' could be found (are you missing a using directive or an assembly reference?)"</code></p>
  
  <p><p> And after changing it to <code>Multiple="Multiple"</code> I'm getting this following warning:
  <p> <code>Validation (ASP.Net): Attribute 'Multiple' is not a valid attribute of element 'FileUpload'.</code></p>