0

I have a problem with "FileUpload" control from DOTVVM.
My project is in ASP Core 2 and I use DOTVVM.

I added to the project:

  1. Folder App_Data / Temp
  2. I have added options.AddUploadedFileStorage ("App_Data / Temp") to the DotvvmStartup file in the ConfigureServices section;
  3. In the .dotcontrol file I added:
<dot: FileUpload UploadedFiles = "{value: Files}" AllowMultipleFiles = "true" />

When I click the button nothing happens.

  1. In the console (Firefox developer tools) an error appears:

    TypeError: t.document.getElementById (...) is null

  2. When I set breakpoint to ConfigureServices (IDotvvmServiceCollection options), the program does not enter this block of code

The problem appears in version 2.0

Please help

user2881533
  • 39
  • 1
  • 1
  • 4
  • >When I set breakpoint to ConfigureServices (IDotvvmServiceCollection options), the program does not enter this block of code This seems that you don't register DotVVM at all. It's strange that something appears in the browser, does anything else work correctly? Is the `DotvvmStartup.Configure` method invoked? – exyi Apr 17 '19 at 19:27
  • Thanks for the suggestion. I know where was error. In the Startup file in the ConfigureServices section, I had services.AddDotVVM (); instead of services.AddDotVVM (); – user2881533 Apr 17 '19 at 21:37
  • Ahh, that's quite nasty API, sorry for that. Unfortunately, I don't see a way to avoid this nastiness in the API without breaking compatibility :( Could you just please answer the question with this solution? Hopefully, it will help someone else. – exyi Apr 20 '19 at 18:47

1 Answers1

0

I know where was error. In the Startup file in the ConfigureServices section, I had services.AddDotVVM (); instead of services.AddDotVVM ();

user2881533
  • 39
  • 1
  • 1
  • 4