I'm relatively new to Razor pages and have a question about posting to a controller action handler from a form on a Razor page. (It's in a file upload section, but I think I'm having more trouble with the route than file upload...?)
I have something like:
<form action="/UploadTheFile/Upload" ... method="post">...</form>
And I have a controller class (created with Visual Studio add new controller) that looks something like this:
...
namespace Controllers
{
public class UploadTheFileController : Controller
{
[HttpPost]
public async Task<IActionResult> Upload(IFormFile file)
{
...
}
}
}
When the form submits (using fiddler, I see the post), I get a 404 not found error.
What am I doing wrong? How do I tell Razor/asp.net-core-2.1 the route?
Thanks, Owen