I am building a new page which should go to the public site, not admin.
I can make it work with method="get" but with method="post" i will always get
"Page Not Found"
This is my form:
@model Nop.Plugin.Admin.ComplaintSystem.Models.ComplaintSearchModel
<form asp-controller="ComplaintPublic" asp-action="CreateOrUpdateUserComplaint" id="frmComplaintPublic" method="post">
<nop-antiforgery-token />
<input type="submit" name="test" value="Test" />
</form>
This is my action method:
public class ComplaintPublicController : BasePluginController
.....
[HttpPost]
public async Task<IActionResult> CreateOrUpdateUserComplaintAsync(ComplaintSearchModel complaintSearchModel)
I have this in my RouteProvider:
public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
{
endpointRouteBuilder.MapControllerRoute(
"Plugin.Admin.ComplaintSystem.ComplaintPublic",
"ComplaintPublic/CreateOrUpdateUserComplaint",
new { controller = "ComplaintPublic", action = "CreateOrUpdateUserComplaintAsync" }
);
}
Can anyone point me to what is wrong here?