Massi
Massi
CC#
Created by Massi on 2/19/2024 in #help
2 actions in one method
Hey there, I am new to C# and ASP.NET, what I am trying to accomplish now is to make account area where person updates details regarding their account. However no luck passing file and some form fields together. Any help, please? Using ASP.NET Core 8 and MVC 5. Thanks in advance.
[Authorize]
public async Task<IActionResult> Settings(IFormFile profilePhoto)
{
...
}

[HttpPost]
[Authorize]
public async Task<IActionResult> Settings(UserSettingsVM model)
{
...
}
[Authorize]
public async Task<IActionResult> Settings(IFormFile profilePhoto)
{
...
}

[HttpPost]
[Authorize]
public async Task<IActionResult> Settings(UserSettingsVM model)
{
...
}
7 replies