0

I am currently building a website and want the owner to be able to upload photos for his products and have been able to figure almost everything out on the windows azure help page. However I am trying to use the following code

public void Upload(IEnumerable<HttpPostedFileBase> file)
{
    //code goes here
}

But the HttpPostedFileBase uses System.Web.Abstractions, however when I try to use that

using System.Web;
using System.Web.Abstractions;

It won't let me call System.Web.Abstractions, I have looked online and have found this solution https://stackoverflow.com/a/1911158/2558743 but I don't completely understand what they are saying. Can anyone explain it better / help me? Thanks in advance

Community
  • 1
  • 1
Derked
  • 934
  • 10
  • 17

1 Answers1

1

Make sure that you've added the System.Web.Abstractions assembly to your project. You can verify this by going to the Solution Explorer, go to your project and look in the "folder" References. You should see a System.Web.Abstractions entry there.

If it's not visible, right-click on the References folder and choose "Add reference". Choose the tab ".NET" and search for System.Web.Abstractions.

Now you should be able to use HttpPostedFileBase. If you're not seeing the System.Web.Abstractions entry when you are trying to add the assembly, make sure you're project is at least .NET Framework 3.5 (see MSDN documentation).

thomasvdb
  • 739
  • 1
  • 11
  • 32
  • I think it also means remove the line 'using System.Web.Abstractions;' - one you have added it as an assembly the classes should be available with 'using System.Web;'. – Rob Oct 29 '13 at 08:10
  • when i go to References -> System.Web.Abstractions is there, but if I double click on it and try to expand it, there is nothing there. If I expand System.Web, there is a lot there – Derked Oct 29 '13 at 08:16
  • Are you looking in the References of your project? Based on your explanation you're looking in the Object browser and then I expect the behaviour you're telling me :) This is a screenshot of the explanation in my answer: http://iprodeveloper.com/content/content/65330/references_f01.jpg – thomasvdb Oct 29 '13 at 08:43
  • Didn't know that multiple projects had different references. This was able to fix my problem. Thanks! – Derked Oct 30 '13 at 01:07